简体   繁体   中英

EnterpriseLibrary PolicyInjectionSettings and Unity 4.0 update compilation error

I have update to Unity 4.0 and the code below gives me a compilation error with Enterprise Library 6

var container = new UnityContainer();

var policyInjectionSettings = (PolicyInjectionSettings)source.GetSection(PolicyInjectionSettings.SectionName);
            policyInjectionSettings.ConfigureContainer(container);

The compilation error is: Enterprise Library The type 'IUnityContainer' is defined in an assembly that is not referenced. You must add a reference to assembly Microsoft.Practices.Unity, Version=3.0.0.0

Can some one help me?

Thanks in advance

I had recompiled the PIAB package upgrading the Unity packages and the new dll (Microsoft.Practices.EnterpriseLibrary.PolicyInjection.dll) works!!. So indeed the owners of package should update the NugGet Package to Unity 4.0

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM