NET专家,
我遇到了问题,希望你能提供帮助。
是否可以使用app.config / web.config中的绑定重定向功能降级依赖项引用?
我的应用程序中有两个引用的dll。这些是强名称,一个(core.dll)依赖于另一个(common.dll) 我试图引用旧版本的common.dll库。
我收到了这个错误:
Assembly 'Core, Version=3.1.0, Culture=neutral, PublicKeyToken=87dca562359a030a'
uses 'Common, Version=3.1.0, Culture=neutral, PublicKeyToken=87dca562359a030a'
which has a higher version than referenced assembly
'Common, Version=3.0.0, Culture=neutral, PublicKeyToken=87dca562359a030a'
我已尝试在app.config中使用此绑定重定向:
<dependentAssembly>
<assemblyIdentity name="Common" publicKeyToken="87dca562359a030a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="3.0.0"/>
</dependentAssembly>
这不能解决错误。
我们正在开发核心&amp;常见的依赖关系。 源项目(核心和普通)的变化能解决这个问题吗? 我确保core.csproj不需要特定版本的common。 在核心的csproj文件中,我有这个:
<Reference Include="Common, Version=3.1.0, Culture=neutral, PublicKeyToken=87dca562359a030a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Common.3.1.0\lib\net35\Common.dll</HintPath>
</Reference>
是否可以使用bindingredirect降级依赖项?
我很感激我能得到任何帮助!
谢谢,
的Eyal