I have a .net test class. In the Initialize method, I create a windsor container and make some registrations. In the actual test method, I call a method on the controller class but the interceptor does not work and the method gets directly called. What are potential reasons for this?
Here is all the related code:
Test.cs:
private Some...
I have inheritted some code in which the MVC Controller classes all get their constructors called by Castle....DefaultProxyFactory.Create() somewhere along the line (the call stack drops out to the <external code>, which isn't helping.)
So, basically, how would I go about finding out where Castle is being told how to call the constructo...
I am attempting to use the WindsorContainer, but I need to turn off Property Injection for the entire container. Here's the code I was trying, but it doesn't seem to have an effect.
this.Container = new WindsorContainer(new XmlInterpreter(new ConfigResource("Dependencies")));
this.Container.Kernel.ComponentModelBuilder.RemoveContributo...
Hi,
I have the following classes:
class Repository : IRepository
class ReadOnlyRepository : Repository
abstract class Command
abstract CommandImpl : Command
{
public CommandImpl(Repository repository){}
}
class Service
{
public Service (Command[] commands){}
}
I register them in code as follows:
var container = new Contai...
I'm working on getting FluentValidation working with Castle Windsor. I already have a wrapper around Castle Windsor. Here is the code for that:
public class ResolveType
{
private static IWindsorContainer _windsorContainer;
public static void Initialize( IWindsorContainer windsorContainer )
{
_windsorCont...
I've already done many configs where dictionaries are passed into services in the <parameters> block.
But what I find myself needing right now is to build a NameValueCollection (allowing multiple entries with the same key) or a Collection of KeyValuePair objects.
The reason for this is im not using this dictionary to look up b when giv...
interface IUserService
class LocalUserService : IUserService
class RemoteUserService : IUserService
interface IUserRepository
class UserRepository : IUserRepository
If I have the following interfaces and classes, where the IUserService classes have a dependency on IUserRepository. I can register these components by doing something lik...
I have code (simplified)
Configuration:
_container.AddComponent<IRepository<Project>, FakeProjectRepository>();
var instance = new List<Project>();
_container.Kernel.AddComponentInstance<IList<Project>>(instance);
Class:
class FakeProjectRepository: IRepository<Project>
public FakeProjectRepository(IList<Project> entities)
{
...
Hello,
I am happily using Castle's WcfFacility. From Monorail I know the handy concept of Rescues - consumer friendly results that often, but not necessarily, contain Data about what went wrong.
I am creating a Silverlight application right now, doing quite a few WCF service calls. All these request return an implementation of
public ...
I have a system that I'm using to test some new architecture. I have the following setup (In MVC2 .Net - C Sharp):
View < Controller < Service < Repository < DB
I'm using Castle Windsor as my DI (IoC) controller, and this is working just fine in both the Service and Repo layers. However, I'm now at a point where I would like to pass an...
Silverlight version of Windsor container does not provide XmlInterpreter() for reading bindings from config file. Could someone suggest how can I implement my own interpreter?
The online document suggest reading a configuration file, creating an instance of IConfiguration and registering them into IConfigurationStore.
How and where can...
Using Castle Windsor, I want to configure a generic service with a type parameter; and have it implemented by a known concrete type that implements the service with a specific type as the generic parameter. Expressed as a unit test, I would like to get the following to work:
[TestClass]
public class WindsorTests
{
[TestMethod]
p...
This isn't a very simple question, but hopefully someone has run across it.
I am trying to get the following things working together:
MVC2
FluentValidation
Entity Framework 4.0 (POCO)
Castle Windsor
I've pretty much gotten everything working. I have Castle Windsor implemented and working with the Controllers being served up by the ...
I have an ASP.net MVC application that is using NHibernate under the covers for data access. I'm using the Windsor container to handle injecting ISession references into each controller.
This works great, but now I'm looking to expand my application with a pluggable architecture so that I can have a core product and specific add-ons. ...
Hi! Am working on a design of a project. I would like to move the implementation away hence to decouple am using interfaces.
interface IFoo {
void Bar();
void Baz();
}
The assemblies which implemented the above interface would be drop in some predefined location say "C:\Plugins" for eg:
project: A
class A : IFoo {
}
when compile...
I would like to upgrade my FluentNHibernate to version 1.1, but I found out it uses Castle.Core 1.1.
I use Castle.Windsor 1.2 in my app which works with Castle.Core 1.2.
I now need to find a version of Castle.Windsor that uses this earlier version of Castle.Core, but I can't find it anywhere.
What do you recommend I should do?
Wait...
Consider the following example:
public interface ITask
{
void Execute();
}
public class LoggingTaskRunner : ITask
{
private readonly ITask _taskToDecorate;
private readonly MessageBuffer _messageBuffer;
public LoggingTaskRunner(ITask taskToDecorate, MessageBuffer messageBuffer)
{
_taskToDecorate = taskToDec...
I am building a set of class libraries that produce office open xml based reports and I am using a static Windsor IoC container.
My problem is that one possible entry point to the reporting system is via a web front end which means that the reporting systems static IoC Container is being shared amongst multiple web requests which causes...
How do I get a list of all IRegistrations/ComponentRegistrations in my WindsorContainer or its kernel? I can see a way of doing this by wiring to the ComponentRegistered event and tracking there, but is there an eaiser way?
Thanks.
...
I have a component that has a dependency on UrlHelper that I need to register using Castle Windsor. UrlHelper in turn has depdendencies on RequestContext (and RouteCollection).
Now my controller has a Url property of type UrlHelper but cannot really access this as far as I can tell.
What is the most efficient way to register my UrlHelp...