castle-windsor

Is there any way to add references without recompiling in .NET?

I am using a IoC Container (Castle Windsor) to instantiate classes accordingly to the configuration file. If I want to add classes from a new dll that didn't exist when I compiled the project, there is any way to do that without recompiling? Edit: As this project is a Service Host for WCF service, and the classes that I want to include ...

castle windsor auto registration from two different assembly?

container.Register( AllTypes.Pick().FromAssembly(typeof (UserRepository).Assembly) .WithService.FirstInterface()); Currently the code above will work fine if the interface are also in the same assembly but it will blow up if IUserRepository is from a different assembly. Is auto registration from two different a...

initialize castle container from a stream (not file)

Is it possible to initialize a castle container (windsor) by passing a stream to the XmlInterpreter somehow? It appears that the current implementation only supports files. thanx, -tzurs ...

How to programmatically register a component that depends on a list of already registered components with Castle Windsor?

I'm programmatically registering a group of services that all implement the same interface, IRule. I have another service that looks like this: public class MyService { private IEnumerable<IRule> _rules; public MyService(IEnumerable<IRule> rules){ _rules = rules; } } Hammett posted something that looked like what ...

What is the recommended life-time for a windsor object for integration testing?

Just looking for some advice really. I've had to write some integration tests to test some BL I need to access (later from the web app) and I have configured them to use singleton life-cycle. I will use in the web application 'PerWebRequest'. Just really assessing whether or not this is a good thing to do? or if it matters? ...

Castle and generics

Considering this code : interface IRepository<T> { void Save(); } class Repository<T> { public virtual void Save() // something { } } interface IOtherRepository : IRepository<OtherClass> { void Other(); } class OtherRepository : Repository<OtherClass>, IOtherRepository { public override void Save() // something d...

IOC on IValidationDictionary with Castle Windsor

I'm new to Castle Windsor and am just using the latest version. I've created entries for my repositories which are working fine but I have one final dependency that I'm passing into my controller. I've created a ModelStateWrapper which inherits from IValidationDictionary. The ModelStateWrapper takes a ModelStateDictionary in it's constr...

wcf - disposing proxies properly

I am using wcf 4 and trying to use some Ioc container to resolve service dependencies. I was looking at Castle Windsor and StructureMap. I haven't use any of them with wcf. The scenario is that I have IService1 and Iservice2. Service1 is using service2: public class Service1 : IService1 { public Service1(IService2 service2) { ...

Registering an Object that has a string array as a parameter using Castle Windsor Fluent Registration API

I have a hopefully simple question... I am trying to change over from the XML registration to the Fluent Registration API, but am having one problem with registering objects that require an array as a constructor parameter. For example <component id="Example" lifestyle="transient" service="Test, Example.Test" type="Test, E...

Convert Castle Windsor xml config to C# code

I want to convert something like this: <components> <component id=""service1"" service=""WindsorTests.IService, MyAssembly"" type=""WindsorTests.Service1, MyAssembly""/> <component id=""service2"" service=""WindsorTests.IService, MyAssembly"" type=""WindsorTests.Service2, MyAssembly""/> <component id=""consumer"" typ...

Castle Windsor WCF Facility host based only on a WCF service interface?

I have runtime provided WCF serrvice inteface : [ServiceContract] public interface IHelloService { [OperationContract] string SayHello(string message); } What I'd like to do with my Windsor container (once for each provided service interface) : container.Register(Component .For(typeof(IHelloService)) ...

Castle components dispose order

We have a number of castle windsor components declared in a config file. Some of the components somewhere deep inside might require the services of other components. The problem is when the application is being closed and the Container is being disposed. During Dispose()/Stop() of the Startable/Disposable component (A) when it requires...

Set Nullable property to null via Windsor configuration file?

How to set a Nullable property of a class to null through Windsor configuration file? Let's say I have a class like this: public class MyComponent { public int? MyProperty { get; set; } } and a configuration file similar to this: <component id="MyComponent" ...> <parameters> <MyProperty>!!! what do I put here? !!!</My...

I am looking for a simple yet practical and robust IOC\DI framework for .net

I am going to use it in a project with less-experienced developers so a complex framework such as Spring.NET is not an option. I was thinking about: Ninject Castle Windsor StructureMap Which would present a moderate learning curve without losing flexibility? and another question - where is the correct place to put the configuration?...

Which IOC runs in medium trust

Hi I am trying to get a website running with Mosso that has Castle Windsor as my IOC, however I am getting the following error. [SecurityException: That assembly does not allow partially trusted callers.] GoldMine.WindsorControllerFactory..ctor() in WindsorControllerFactory.cs:33 GoldMine.MvcApplication.Application_Start() in Glob...

how to get dependencies injected in constructors in Windows Forms

in asp.net-mvc I have the Windsor Controller Factory that injects all the dependencies into the controllers, but how do you get this in Windows Forms ? for example if have this Form1, how am I going to get an instance of Form1, should I use resolve (which is called ServiceLocator and anti-pattern by some ppl)? public class Form1 { ...

Comparing Castle Windsor, Unity and StructureMap

In a follow up to Krzysztof’s statement that Windsor does a lot more than other IoC’s, I wanted to understand how these IoC’s stack up against each other and the benefits/additional facilities that castle Windsor provides. Are there any comparisons? Can someone help me understand the additional features that Castle Windsor provides ov...

Where can I download the Castle Windsor WcfIntegration Facilities dll?

I would like to integrate Castle Windsor into a WCF project and have read that you can hook it up using the WcfIntegration facility but I am unable to find where to download the dll. Can anyone help? ...

Castle Windsor: Find an implementing assembly and used it.

How do I tell castle to pick up an interface implementation from the assemblies in the executing directory. E.g. How do I tell castle to find an implementation for ILog and then If I drop log4net among the assemblies in the executing directory, it should pick it and use it. Tomorrow if I decide to change log4net to Nlog it should pick...

Can I use an IoC container to create a dependency that requires a runtime value?

I'm an IoC newbie, so I'm wondering if it's even the right tool for the job I want to do. I'm writing a multi-tenant application, and there are several places that we might want to use different implementations of interfaces based on the organization to which the currently logged-on user belongs. Say, for example, when a user from ...