I want to handle application's internal exceptions in a consistent way so that REST web services return errors in a RESTful way.
I'm using Castle's WCF integration and I couldn't find any good sources on how to do handle errors using WcfIntegration.WindsorServiceHostFactory. The only solution that comes to mind is to use Castle's inter...
I have a custom IErrorHandler which catches certain exceptions thrown from web services and translates them to HTTP status codes. The problem is that, even when the handler sets the status code (404 for example), the Web server (IIS 7.5) always returns 400 (Bad Request). I tried other status codes and the result is the same ("The server ...
Hi there,
We want to be able to Resolve services using Castle for implementation with private constructors.
This is a fictive "use case" for that:
public class SingletonClass : ISingletonClass
{
private SingletonClass() {...} // Class users cannot create an instance
public ISingletonClass Instance
{
get
{
...
Hi everybody!
I want to implement multi tenancy using Windsor and i don't know how to handle this situation:
i succesfully used this technique in plain ASP.NET MVC projects and thought incorporating in a RIA Services project would be similar.
So i used IHandlerSelector, registered some components and wrote an ASP.NET MVC view to verify...
I'm struggling with getting IOC to work in a remoting scenario. I have my application server set up to publish Services (SingleCall) which are configured via XML.
This works just like this as we all know:
RemotingConfiguration.Configure(ConfigFile, true);
lets say my service looks like that (pseudocode)
public class TourService : IT...
I've got components:
public interface IFoo
{ }
public interface IBar
{ }
public class Foo : IFoo
{
public IBar Bar { get; set; }
}
public class Bar : IBar
{
public IFoo Foo { get; set; }
}
I've got Castle-Windsor configuration:
Container.AddComponent("IFoo", typeof (IFoo), typeof (Foo));
Container.AddComponent("IBar", ty...
So my company uses Castle Windsor IoC container, but in a way that feels "off":
All the data types are registered in code, not the config file.
All data types are hard-coded to use one interface implementation. In fact, for nearly all given interfaces, there is and will only ever be one implementation.
All registered data types have a ...
Is it possible to perform some custom processing when Windsor instantiates a type?
Something similar to:
container.Register(
AllTypes.Pick()
.FromAssembly(Assembly.GetExecutingAssembly())
.BasedOn<MyMarkerInterface>()
.WhenInstantiating(instance...
I am having difficulty with managing configuration of an ASP.Net application to deploy for different clients. The sheer volume of different settings which need twiddling takes up large amounts of time, and the current configuration methods are too complicated to enable us to push this responsibility out to support partners.
Any suggesti...
Given the following classes/interfaces :
class Repository<T> : IRepository<T> {}
class UserRepository : Repository<User>, IUserRepository {}
Is there a simple way to transform this :
container.Register(
Component.For<IUserRepository>()
.Forward<IRepository<User>>()
.ImplementedBy<UserRepository>()
);
Int...
I'm self-hosting several services where I do this to register the service:
host = new ServiceHost(typeof(MyService));
host.Open();
Behind the scenes, wcf instantiates my service via the default constructor.
Is it possble to use the WCF Integration Facility of Castle Windsor to get WCF to call on Windsor to create the service when I a...
public class TheController : Controller
{
IThe the;
public TheController( IThe the)
{
//when User.IsInRole("r1") The1 should be injected else r2
this.the = the;
}
}
public class The1 : IThe{}
public class The2 : IThe{}
//anybody knows a good way of doing this ?
...
Hi,
I'm having issues with my WCF service. I need to do a windsor container injection pre application_start and noticed I can use the AppInitialise method. It works on visual studio debug but when I deploy to IIS the code does not get fired.. I initialized the class as follows
public static class Class1
{
public static void AppInit...
I am trying to access a custom attribute applied to a method within a castle interceptor, e.g.:
[MyCustomAttribute(SomeParam = "attributeValue")]
public virtual MyEntity Entity { get; set; }
using the following code:
internal class MyInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
if (invo...
At a certain point, during the running of my app, I want Castle.Windsor to release everything cached in memory. Is this impossible for a singleton object?
...
Hi all,
I want to use Windsor container and its silverlight version in my .net 4.0 framework and silverlight 4.0 solution. I even compiled the source code for .net 4 but unit tests didnt pass. Has anybody tried to do this?
I also tried Unity IOC framework and that doesnt even compile.
...
I have a WCF service application that uses a component called EnvironmentConfiguration that holds configuration information for my application. I am converting this service so that it can be used by different applications that have different configuration requirements.
I want to identify the configuration to use by allowing an additi...
I am using Castle Windsor for IoC, and have the configuration held in the web.config/app.config, using the following factory:
public static TYPE Factory(string component)
{
var windsorContainer = new WindsorContainer(new XmlInterpreter());
var service = windsorContainer.Resolve<TYPE>(component);
if (service ...
I have a class with constructor like this:
public UserRepository(IBlockRepository blockRepos)
{
}
and again, I have another class with the constructor like this:
public BlockRepository(IUserRepository userRepo)
{
}
this causes the Windsor error:
Castle.MicroKernel.Handlers.HandlerException: Can't create component 'UserReposito...
How can I allow one of my string parameters to be an empty string?
I get this error when I try either nothing or a single space (names changed):
Could not resolve non-optional dependency for 'test.User' (MyNamespace.MyObject). Parameter 'userName' type 'System.String'
...