Questions tagged [castle]

Castle is an open source project for .net that aspires to simplify the development of enterprise and web applications.

Castle is an open source project for .net that aspires to simplify the development of enterprise and web applications. Offering a set of tools (working together or independently) and integration with others open source projects, Castle helps you get more done with less code and in less time.

Castle subprojects include:

Other smaller projects also exist, notably

383 questions
19
votes
4 answers

Testing Castle windsor Component with PerWebRequest lifestyle

I'm trying to do some testing with castle windsor involved, in one of my tests I want to check the windsor installers, so I check that the container can resolve my components given its interface. So far, so good, the problem starts when the…
17
votes
6 answers

How to overwrite a component with castle windsor?

I want to redefine an (default) implementation in a given windsor-container. Is that what OverWrite is for? Doesn't work, though. container.Register( Component.For() …
13
votes
3 answers

Will castle bytecode provider for NHibernate 3.2.GA be available in nuget?

As you know NHibernate 3.2 has native bytecode provider, which has some breaking changes with castle bytecode provider. For example: public class SomeEntity { public virtual string SomeProperty { get; **private set;**} } Is working fine with…
hazzik
  • 13,019
  • 9
  • 47
  • 86
12
votes
2 answers

Castle Windsor Transient Disposables

I know this has been discussed ad nauseum...but I have an issue with the way Windsor is tracking Transient IDisposable objects. I understand the benefits of letting Windsor manage my IDiposables...but I don't like it. What happens if I want to wrap…
Jeff
  • 35,755
  • 15
  • 108
  • 220
11
votes
2 answers

IoC - Constructor takes a runtime value as one parameter and a service as another

I have a WPF app which, when it starts, looks at the file system for some config files For each config file it finds, it displays some info in a different window Each window has an associated ViewModel object which is bound to the windows…
ChrisCa
  • 10,876
  • 22
  • 81
  • 118
11
votes
6 answers

Using MVC and fluent Nhibernate, how do I validate unique fields on my ViewModel before I bind them to my Domain Object and Save them?

I have a website where I allow users to create new Part records. I'm trying to figure out the best way to validate specific fields for uniqueness. I want to make sure that somebody doesn't try to add a Part with PartNumber 1234 if that PartNumber…
10
votes
2 answers

Castle DynamicProxy : How to Proxy Equals when proxying an interface?

I need to use Castle DynamicProxy to proxy an interface by providing an instance of it to ProxyGenerator.CreateInterfaceProxyWithTarget. I also need to make sure that calls to Equals, GetHashCode and ToString hits the methods on the concrete…
driis
  • 161,458
  • 45
  • 265
  • 341
9
votes
1 answer

Does Castle-Windsor support ForwardedTypes via XML configuration

I have a class that implements multiple interfaces. I would like to register these interfaces via XML. All I've found is documentation for the new Fluent Interface. Is this option supported via XML? What would be involved in adding this feature?
Dan
  • 710
  • 5
  • 15
8
votes
2 answers

How are components removed with Castle 3.0?

I have IWindsorContaner which exists for the whole application lifetime. For Unittests it is possible to register mocks/stubs, etc. under their Type. When the test is finished and the fixture is disposed the registered components in forthe test are…
Antineutrino
  • 1,093
  • 3
  • 10
  • 26
8
votes
2 answers

Castle windsor Adding conditional dependency

I have 2 implementations of the same interface and want to use implementation1 if the user is logged in or implementation2 if the user is not logged in. How can I configure this with castle windsor?
Mark
  • 81
  • 2
8
votes
2 answers

How do you use Castle Windsor - Fluent Interface to register a generic interfaces?

Castle Windsor just came out with a Fluent interface for registering components as an alternative to using XML in a config file. How do I use this Fluent interface to register a Generic interface? To illustrate, I have: public interface IFoo { …
Phil
  • 2,143
  • 19
  • 44
8
votes
1 answer

What is NHibernate session exactly?

It's a long time I'm working with NHibernate session through frameworks like Castle ActiveRecord but never understood what is a session exactly and how should manipulate. Can anybody help? Is there any concise resource? Thanks in Advance
Afshar Mohebi
  • 10,479
  • 17
  • 82
  • 126
8
votes
2 answers

Can I define custom attributes for proxy type in Castle Windsor

I have a class that I proxy it with Castle Dynamic Proxy. I want to add some custom Attributes to proxy methods (which is not defined in proxied class). Is this possible. I want this because I want to generate ASP.NET Web API layer for my…
8
votes
1 answer

Injecting WCF fault contract using Castle Dynamic Proxy Generation

I am currently working on WPF application with a WCF backend. We have implemented a client logging solution and a server logging solution for exception handling, and they work great, but it is often difficult to tie the information together over…
BernicusMaximus
  • 250
  • 2
  • 13
7
votes
2 answers

Autofac class interception doesn't work in a certain setup

I have an IoC setup with Autofac and use AoP interceptors. Normally, I use interface interceptors registered like this: var builder = new ContainerBuilder(); builder.RegisterType() .As() .UsingConstructor(new Type[0]) …
Jacek Gorgoń
  • 3,206
  • 1
  • 26
  • 43
1
2 3
25 26