项目引用了错误版本的 DLL

Project referencing wrong version of DLL

我的项目引用 Microsoft.Xrm.Sdk.dll 并且我包含了版本 9.0.0.0 但是当 运行 应用程序时我收到以下错误:

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

在 VS 中查看文件属性时:

我曾尝试在我的系统上寻找 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>

在构建时的输出window中:

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

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