I'm using OpenRasta 2.0.3214.437 in an ASP.NET 4 web application. I'm registering a custom dependency in the internal container using:
ResourceSpace.Uses.CustomDependency<IRepository, Repository>(DependencyLifetime.PerRequest);
This works perfectly for the first request; the second request throws an OpenRasta.DI.DependencyResolutionException after logging the message:
Ignoring constructor, following dependencies didn't have a registration: IRepository
DependencyLifetime.Singleton and DependencyLifetime.Transient work fine, just the PerRequest seems to have the issue. I'm running in Cassini. Am I doing something wrong?
Workaround to this issue:
Implement an IPipelineContributor:
Then register the contributor in your IConfigurationSource: