项目引用错误版本的DLL

问题描述 投票:0回答:1

我的项目引用了Microsoft.Xrm.Sdk.dll,我已经包含了9.0.0.0版,但在运行应用程序时出现以下错误:

enter image description here

当单步执行代码并询问实际使用的文件版本时:

enter image description here

在VS中查看文件属性时:

enter image description here

我曾尝试在我的系统上查找dll的其他副本并删除它们但这没有帮助。我还在app.config中尝试了bindingRedirect:

  <dependentAssembly>
      <assemblyIdentity name="Microsoft.Xrm.Sdk" publicKeyToken="31bf3856ad364e35" culture="neutral" />
      <bindingRedirect oldVersion="5.0.0.0" newVersion="9.0.0.0" />
      <codeBase version="9.0.0.0" href="file:///C:/DLLS/Microsoft.Xrm.Sdk.dll" />
  </dependentAssembly>

在构建时的输出窗口中:

enter image description here

在使用bindingRedirect时,似乎大多数人都可以使用工作,即使只是作为测试。我还可以做些什么?

c# .net visual-studio dll app-config
1个回答
0
投票

尝试从您的引用中删除引用“Microsoft.Xrm.Sdk.dll”并安装nuget Microsoft.CrmSdk.Workflow

© www.soinside.com 2019 - 2024. All rights reserved.