c#清单定义与程序集引用不匹配

c#清单定义与程序集引用不匹配,c#,.net,C#,.net,我正在使用Azure WorkerRole和NServiceBus编写一个应用程序。运行时,我在运行时遇到以下异常: Autofac.Core.DependencyResolutionException: An exception was thrown while executing a resolve operation. See the InnerException for details. ---> Exception has been thrown by the target of

我正在使用Azure WorkerRole和NServiceBus编写一个应用程序。运行时,我在运行时遇到以下异常:

Autofac.Core.DependencyResolutionException: An exception was thrown while executing a resolve operation. See the InnerException for details. --->
Exception has been thrown by the target of an invocation. (See inner exception for details.) ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --->
Microsoft.WindowsAzure.Storage.StorageException: Could not load file or assembly 'System.Spatial, Version=5.6.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) --->
System.IO.FileLoadException: Could not load file or assembly 'System.Spatial, Version=5.6.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
如果我查看VS中对System.Spatial的引用的属性,我会看到版本5.6.2.0

在我的app.config文件中,我放置了以下内容:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
          <assemblyIdentity name="System.Spatial" publicKeyToken="31bf3856ad364e35" culture="neutral" />
          <bindingRedirect oldVersion="0.0.0.0-5.6.2.0" newVersion="5.6.2.0" />
       </dependentAssembly>
    </assemblyBinding>
 </runtime>

但这没用


如何修复或进一步诊断缺失的内容?

启用自动绑定重定向可能会有所帮助。试试看。看见