I get an error message "Object reference not set to an instance of an object." when I try to use an UserRepos repository. Question is how can I resolve user repository at the start of the application (ASP.NET MVC) What is wrong here?
public class MyApplication : HttpApplication
{
public IUserRepository UserRepos;
public IWindsor...
Where can I find a decent tutorial/explanation of using Castle Validators with ASP.NET MVC2?
I want to go with Castle because I'm not fond of the fact that I can't test my POCOs using Data Annotations without copying the logic of grabbing the attributes and calling isValid on all of them. I'm much more fond of the fact that with Castle ...
I'm trying to host a WCF service inside a console app using Castle-Windsor 2.5 (.NET 4) with the following code:
new WindsorContainer()
.AddFacility<WcfFacility>()
.Register(
Component.For<IMyService>().ImplementedBy<MyService>()
.ActAs(new DefaultServiceModel()
...
I'm working on a web application that uses a couple of services to synchronize data with external resources. The application and the services share the same data layer and use Castle Windsor to implement IoC.
In the web application there is the a PerWebRequest lifestyle which limits the lifetime of an instance to the lifetime of a reque...
The app I inherited uses the fluent interface for configuring our Windsor container, and it's this big glob o' configuration that's pretty disgusting.
In the past I created an extension method container.AddModule and then created modules that were passed in the container and registered services a la StructureMap for the different "modul...
Hello again stackoverflowians,
I thought it was about time that I learnt how to use a DI framework. I've heard a lot of good things about Castle Windsor so I decided to go with that. Now there are PLENTY of tutorials out there on how to use it, however, I cannot find much useful information about what to do when Generics get involved....
Hi Every one
in code i can do some thing like this:
container.Register(AllTypes.FromAssemblyNamed("AssemblyName"));
can i do the same thing using Configuration file "Windsor.Config"???
...
I have a ILazyComponentLoader that registers any type on demand. My container also has an IModelInterceptorsSelector. When I resolve an unknown type, the ILazyComponentLoader is invoked correctly and then the IModelInterceptorsSelector is also invoked and returns the correct interceptors, but the resulting instance (which is indeed creat...
I have the following interface
public interface ISelectable
{
bool Selected {get;set;}
}
and impl
public class Selectable:Iselectable
{
bool Selected {get;set;}
}
and my impl for SelectableInterceptor
public void Intercept(IInvocation invocation)
{
if (invocation.Method.DeclaringType.Equals(typeof(ISelectable)...
I have setup my MVC project to use Fluent Validation and Castle Windsor and everything is working wonderfully. I am using a custom Validator Factory to take into account that I am also using Entity Framework and have to account for the dynamic proxies that get wrapped around my POCO classes. Here is my CastleWindsorValidatorFactory:
p...
Hi everyone...
There is a way to use Castle ActiveRecord Integration (Castle.Facilities.ActiveRecordIntegration.dll) with multiple databases?
I'm already aware of using NHibernate with multiple database and ActiveRecord as well. But applied to integration facility i don't found anything.
Any suggestions?
Tks!!
...
Hi,
Im using windsor along with the subresolver ArrayResolver and works great besides one thing.
Here the ArrayResolver works the the way it supposed to work.
class SomeClass : ISomeInterface
{
public SomeClass(ISomeDependency[] dependecies)
{}
}
This thing does not work
ISomeDependency[] = container.Resolve<ISomeDependency[]>(...
I just configured Castle-Windsor and am receiving this message:
Type DataModel.IDepartmentRepository is abstract. As such, it is not possible to instansiate it as implementation of DataModel.IDepartmentRepository service.
My Interface looks like this:
namespace DataModel
{
public interface IDepartmentRepository
{
...
Hello,
Situation:
I have an interface, such as
public interface ITestClass
{
string StringElement { get; }
}
There is an implementation for it:
public class TestClassImplementor :
ITestClass
{
public string StringElement
{
get { return "AAA"; }
}
}
I do have a factory that creates an implementation inst...
Hi all
I use Castle Windsor in a couple of web apps just fine by putting the config data in web.config.
So when I decided to use it in a Windows Service I thought it would be a cinch. My app.config file looks like the following:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="castle" type=...
I have to support a new input file format in a system which uses Windsor. I also need to support the old version of the input file during a transition phase.
This will probably be repeated in future, and we'll again need to support the new and the next most recent format.
The import processing is handled by a component, and the new ve...
I just noticed that the IWindsorContainer interface in Castle Windsor includes Dispose().
None of the CastleWindsor tutorials I have seen (e.g. http://dotnetslackers.com/articles/designpatterns/InversionOfControlAndDependencyInjectionWithCastleWindsorContainerPart1.aspx and http://wiki.bittercoder.com/ContainerTutorials.ashx) declare th...
When I have resolved a component using container.Resolve(), and I have finished using it, should I call Release()?
At the moment I call Dispose on any IDisposable that the container has got for me. Should I not call Dispose() on the object, but instead call Release() on the container instead? Does it do the same thing?
Thanks
David
...
Hi. I've ran into a rather hairy problem. There is probably a simple solution to this but I can't find it!
I have a custom HttpHandler that I want to process a request, log certain info then enter the details in the database. I'm using NUnit and Castle Windsor.
So I have two interfaces; one for logging the other for data entry, which a...
I've been using S#arp and have updated the Generate method in AutoPersistenceModelGenerator to work with Fluent NHibernate 1.1. I also changed its assembly name from MyProject.Data to MyProject.Infrastructure and I'm not sure which has caused the problem:
public AutoPersistenceModel Generate()
{
return AutoMap.Assemblies...