aspnet / AspNetWebFormsDependencyInjection

Dependency injection support for ASP.NET Web Forms 4.x

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AspNetWebFormsDependencyInjection not compatible with Unity.Abstractions 4.0.0

kiwiant opened this issue · comments

Due to a breaking change in Unity.Abstractions going from 3.3.1 to 4.0.0, the call to AddUnity this.AddUnity(); gives the error:
Error CS0012 The type 'IUnityContainer' is defined in an assembly that is not referenced. You must add a reference to assembly 'Unity.Abstractions, Version=3.3.0.0, Culture=neutral, PublicKeyToken=6d32ff45e0ccc69f'. dummy_WebApplication1 C:\Data\Source\dummy_WebApplication1\Global.asax.cs 21 Active

Using bindingRedirect doesn't work as the publicKeyToken has changes between the two versions of Unity.Abstractions.

commented

same error,when I update the sample project nuget package “ Unity.Abstractions” going from 3.3.1 to 4.0.0。

Hopped on and updated everything for everyone.

Pull Request
#9

Fork with the updates if you want to pull it for yourself.
https://github.com/houseofcat/AspNetWebFormsDependencyInjection

Any chance of getting @houseofcat 's PR merged? Running into this issue today!

I have gone in an done further updates and its now pulling against the latest versions of Unity once more.

@jmkni @kiwiant @Brunas @indexlang @SteffenHeidrich

commented

I also fixed this in my own version of Unity.WebForms which targets the latest version of Unity: Unity.Container 5.11.1.0: https://github.com/Jehoel/Unity.WebForms

Lovely @houseofcat , thank you!

Warning
This project demonstrates building a dependency injection adapter for the Unity IoC container. It is a point of reference for other adapter authors. Please note that this implementation is for demonstration purposes only and is not being actively maintained.