简体   繁体   English

使用Unity 4.0的Enterprise Library Caching 5.0无法构建

[英]Enterprise Library Caching 5.0 with Unity 4.0 doesn't build

I am migrating from Unity 2.0 to 4.0 because I need to upgrade to PRISM 6 which supports Unity >=4.0. 我正在从Unity 2.0迁移到4.0,因为我需要升级到支持Unity> = 4.0的PRISM 6。 The problem I am encountering is that EnterpriseLibrary 5.0 was built agaisnt Unity 2.0 and when I am trying to build the project I'm getting: 我遇到的问题是EnterpriseLibrary 5.0是在agaisnt Unity 2.0上构建的,当我尝试构建我正在获得的项目时:

Error 68 The type 'Microsoft.Practices.Unity.UnityContainerExtension' is defined in an assembly that is not referenced. 错误68“Microsoft.Practices.Unity.UnityContainerExtension”类型在未引用的程序集中定义。 You must add a reference to assembly 'Microsoft.Practices.Unity, Version=2.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 您必须添加对程序集“Microsoft.Practices.Unity,Version = 2.0.414.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35”的引用。

Here: 这里:

  container.AddNewExtension<EnterpriseLibraryCoreExtension>();

I tried to create a bindingRedirect 我试图创建一个bindingRedirect

  <dependentAssembly>
        <assemblyIdentity name="Microsoft.Practices.Unity" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="2.0.414.0" newVersion="4.0.0.0" />
      </dependentAssembly>

It looks like publicKeyToken has been changed in >=Unity 4.0. 看起来在> = Unity 4.0中更改了publicKeyToken How can I make it work? 我怎样才能使它工作?

I moved to System.Runtime.Caching with FileCache nuget package. 我使用FileCache nuget包移动到System.Runtime.Caching。 It looks like there is no solution for the above problem. 看起来上述问题没有解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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