Comments (7)
@khellang is this related to the PR you sent a while back?
from nancy.bootstrappers.unity.
I experienced the same issue. Is there any workaround or fix in sight?
from nancy.bootstrappers.unity.
Taking the sample from http://www.stefanbader.ch/minimal-sample-self-hosted-nancy-using-owin-unity-bootstrapper-including-xunit-test , for Version 1.2. you need to slightly adapt the customized bootstrapper:
using Microsoft.Practices.Unity;
using Nancy.Bootstrappers.Unity;
namespace NancyOwinBox
{
public class NancyOwinBoxBootstrapper : UnityNancyBootstrapper
{
private IUnityContainer _container;
public NancyOwinBoxBootstrapper(IUnityContainer container)
{
_container = container;
+ _container.AddNewExtension<EnumerableExtension>();
}
protected override IUnityContainer GetApplicationContainer()
{
return _container;
}
}
}
Line:
_container.AddNewExtension<EnumerableExtension>();
is doing the trick.
from nancy.bootstrappers.unity.
@thecodejunkie Yes, I think this might be related.
As @baddonkey mentioned, it should work when calling AddNewExtension<EnumerableExtension>
, but we already do that here, so it must be something else.
Could it be that we have to do the same call for the child (request) container?
@tseel @srgoapp Does it work if you call AddNewExtension<EnumerableExtension>
on the request container in ConfigureRequestContainer
?
from nancy.bootstrappers.unity.
Ah, now I see what's happening here. You're using a container that's not constructed by Nancy. Then you have to manually add the extension, like @baddonkey says.
from nancy.bootstrappers.unity.
I have a pending fix for this at #12. This'll make it "just work" without having to manually add the extension, even if you're using an existing, "external" bootstrapper.
from nancy.bootstrappers.unity.
The fix in #12 will go out with the 1.3 release. Hopefully next week
from nancy.bootstrappers.unity.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nancy.bootstrappers.unity.