I'd like to create a framework that uses IoC without needing any configuration:
So instead of (adjusted from http://www.castleproject.org/container/gettingstarted/part1/code.html):
IWindsorContainer container = new WindsorContainer();
container.AddComponent("someinterface", typeof(ISomeInterface));
ISomeInterface component = (ISomeInte...
Hey everyone..
Trying to make use of the Castle Windsor IoC. I have a very simple application. My interfaces exist in Test.Services namespace. I get the following exception when compiling:
"The type name Test.Services.IParse, Test.Services could not be located"
This is my app.config:
<configuration>
<configSections>
<section na...
I am having trouble wiring the events for my Castle.Windsor IoV components. Even though I have confirmed the methods and the signatures for them, it throws an exception with the message "Object does not match target type".
Can anyone please explain what object exactly its expecting?
My wiring looks like:
<component
id="mailMa...
Hi,
I have a web application based on the sharp-architecture framework. It actually use NHibernate for the dal, and i've added a service layer between the (VIEW-CONTROLLER) and the DAL.
I actually need to implement a scheduler to run my jobs frequently. I will use Quartz.net to do that task. Actually i'm facing a problem. Because I wil...
I have the following:
interface IDefectRepository { /* ... */ }
class MyDefectRepository : IDefectRepository
{
public MyDefectRepository(string url, string userName, string password)
{
// ...
}
// ...
}
I'm using <parameters> to pass the constructor parameters from Web.config. Is there any way that I can store...
I'm a Castle n00b, and am using the Fluent API in Castle Windsor to auto-register implementations to services based on a naming convention (ISomething is implemented by Something). One thing I wanted to support is for auto-registration to pick up dependencies that are in separate dlls, and auto-register those, as well.
So: IFoo is impl...
I'm using Windsor WCF Integration Facility and am curently looking for a way to call a method asnyc. I was considering just using a background worker and doing the work on completion. Is there a more elegant way of doing this, i don't have a good feeling with selected way.
I've looked at the following email: http://groups.google.com/gr...
Given the below configuration
Container.Register(Component.For<A>().Named("foo"));
Container.Register(Component.For<B>().Named("foobar"));
Container.Register(
AllTypes.Pick()
.FromAssemblyNamed("MyAssembly")
.If(t => t.Name.EndsWith("ABC"))
.Configure(c => c.LifeSt...
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<IServiceOperationAuthorization>()
.OverWrite()
.Instance(_authorization)
);
...
Why does the following not intercept calls to IBusinessService with the LogAspect?
container.Register(AllTypes.Of<IBusinessService>()
.FromAssembly(Assembly.GetExecutingAssembly())
.ConfigureFor<BusinessService>(
c => c.Named(typeof(BusinessService).Name)
.Interceptors(InterceptorReference.ForType<LogAspect>(...
I have a class that I want to have access to my IOC container (Windsor), however I don't want to keep a static IWindsorContainer property hanging around - I would prefer to have the container inject itself into any classes that require an IWindsorContainer as a constructor dependency.
I've pulled this off with Unity, but when I try the ...
I have a MixIn that requires some state to operate.
I am registering it as so..
container.Register(Component.For(Of ICat) _
.ImplementedBy(Of Cat) _
.LifeStyle.Transient _
.Proxy.MixIns(New MyMixin()))
When I call container.Resolve(of ICat), I get back a prox...
I'd like to configure the Windsor container so that a single, singleton-style instance can provide two or more services through the container.
I've found that using the same type in multiple component declarations (XML-based config) will result in an instance of that type being created to provide each component's service interface, whic...
Are these equivalent syntaxes for setting component lifestyle?
Component.For<IFoo>()
.ImplementedBy<Foo>()
.LifeStyle.Is(LifestyleType.Transient)
Component.For<IBar>()
.ImplementedBy<Bar>()
.LifeStyle.Transient
...
I've got a personal (learning) project that uses Castle Windsor (with the NHibernate facility) and NHibernate (and ASP.NET MVC and Moq, and SQL Server 2008, all stuff that I want to learn more about).
I attempted to use NHibernate Validator over the weekend, but it needed the 2.1.0Alpha2 build of NHibernate.
Since Castle Windsor 1.0RC3...
I would like to write a test that just ensures that all components registered to my WindsorContainer can indeed be resolved. Anyone have any ideas how I can do that?
...
I have an IAddress class with a few properties. I then have a concrete type that implements this interface. This concrete type has a couple of different constructors I could use. How can I pass parameter values to one of these constructors at run-time? I cannot use the config file as I will be reusing this concrete type multiple time...
Is registering components on castle windsor thread-safe?
I.e., can multiple threads simultaneously register components on the same container instance?
(For the record, yes I am aware that doing so is probably insane.)
...
Hi,
I'm trying to convert my existing site to use WCF to communicate with my services on another box. Currently I use auto-registration to wire-up my services directly. When I try to use the WcfFacility of Windsor I get a ComponentRegistrationException on one of my interfaces that I'm trying to register. The error is below, it only h...
Currently I have a class that looks like this:
public class MyClass : IMyClass
{
public MyClass()
{
//...
}
public MyClass(IMyRepository repository)
{
//...
}
}
In my config file I have IMyClass registered, but not IMyRepository. My intention is for Windsor to use the constructor that doesn't take any pa...