-
Notifications
You must be signed in to change notification settings - Fork 36
Autofac 4.0 #25
Comments
Uuuh... I'll check and come back to you, but we probably wouldn't update anything to require 4.0 until it's out of beta, at least. Maybe @tillig or @alexmg could provide some insight here? BTW, why can't you use .NET 4.5.2 with an older version? 😜 |
Hi khellang The case is that I'm trying to use ASP.NET 4.5.2 and AutofacRegistration.Populate or builder.Populate, either way this extension method exists in Autofac 4.* and as soon I reference that, the AutofacNancyBootstrapper complains about the Autofac version. Normally I would just do an assembly-binding, but that is not possible in vNext, it is being said that assembly-version is carried out by Roslyn, but apparently this is not working. Don't now why, but I guess it has something to do with the target framework that Nancy is built in, at the moment 4.0. In my desperation for a temporary solution, I cloned Nancy.Bootstrappers.Autofac and changed Autofac to version Autofac 4.0.0-alpha2 , but I gave up :) Install-Package : Failed to add reference to 'System.Runtime'. Please make sure that it is in the Global Assembly Cache.
|
Right, so this has nothing to do with .NET 4.5.2, but rather that you're trying to use this in a DNX project? We don't support DNX yet. We have a branch going in the main repo to get Nancy running on it. In fact I think it runs on DNX451, but not on DNXCORE50, right now. Before we ship that, we'll make sure to have a version of the different bootstrappers that works with it. |
Amazing... I will look forward to compatibility with 451. |
Hello, |
If you really want to use Nancy with Autofac on DNX451, you can simply copy the bootstrapper over as source, temporarily. I've even demonstrated it by using DNX's logging infrastructure inside a Nancy module. Here's the output:
|
Wow, thank you so much for this! I was actually just in the process of doing that, but but this helped me as I couldn't get it to compile and hadn't noticed the need for the ComponentContextExtensions.cs. |
No problem 👍 BTW, you don't need Autofac 4.0 to run on DNX. You only need it if you want to use |
HI khellang, I got it to work as you describe, use the code you posted. at https://github.com/khellang/Nancy.Autofac.Dnx I am using Autofac.Framework.DependencyInjection, which contains the Populate method to populate the ContainerBuilder using an IServiceCollection. Thank you so much for everything!! |
Haven't tested it, but I believe radams0x is right on. khellang, I thank you very much for this :) |
Glad to hear 👍 I'll leave this issue open until we get a permanent solution 😄 |
@norgie What are you talking about? You shouldn't have to implement anything. All those methods you mention are implemented by the |
Heh. What version of R# are you using? Some EAP? |
Hello
I was trying to get AutofacNancyBootstrapper to work with Autofac 4.0 because I wanted to use .NET 4.5.2 in Visual Studio 2015, but with no luck.
It seems that AutofacNancyBootstrapper utilizes ILifetimeScope and that appears not to work with Autofac 4.0
So my question... when will I be able to use Autofac 4.0?
Thank you for a great product.
The text was updated successfully, but these errors were encountered: