我正在使用一个使用 NServiceBus (v4.7.0) 队列中的消息的 .Net Web 应用程序。我收到以下异常:
2019-02-20 15:35:13,624 [28] 错误 NServiceBus.Unicast.Transport.TransportReceiver [(null)] - [(null)] - 无法反序列化 ID 为 0942d9eb-126e-4af6-b860-a9f400a3be82 系统的消息.Runtime.Serialization.SerializationException:尝试从传输消息 NServiceBus.TransportMessage ---> System.IO.FileLoadException 提取逻辑消息时发生错误:无法加载文件或程序集'xpto.Contracts,版本 = 1.0.0.0,文化=neutral, PublicKeyToken=6a17a7d57c13b3cf' 或其依赖项之一。找到的程序集的清单定义与程序集引用不匹配。(来自 HRESULT 的异常:0x80131040)---> System.IO.FileLoadException:定位的程序集的清单定义与程序集引用不匹配。(HRESULT 的例外情况:
在 System.RuntimeTypeHandle.GetTypeByName(字符串名称,布尔 throwOnError,布尔 ignoreCase,布尔反射仅,StackCrawlMarkHandle stackMark,IntPtr pPrivHostBinder,布尔 loadTypeFromPartialName,ObjectHandleOnStack 类型)在 System.RuntimeTypeHandle.GetTypeByName(字符串名称,布尔 throwOnError,布尔 ignoreCase,布尔反射, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectOnly, StackCrawlMark& stackMark) 在 System.Type.GetType(String typeName, Boolean throwOnError) 在 NServiceBus.Unicast.Messages c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus 中的 .MessageMetadataRegistry.GetMessageMetadata(String messageTypeIdentifier)。Core\Unicast\Messages\MessageMetadataRegistry.cs:C:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Unicast\Messages\ExtractLogicalMessagesBehavior.cs 中 NServiceBus.Unicast.Messages.ExtractLogicalMessagesBehavior.Extract(TransportMessage physicalMessage) 的第 52 行: C:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Unicast\Messages\ExtractLogicalMessagesBehavior.cs:line 52 中 NServiceBus.Unicast.Messages.ExtractLogicalMessagesBehavior.Invoke(ReceivePhysicalMessageContext context, Action next) 的第 75 行 --- 结束内部异常堆栈跟踪 --- 在 C:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Unicast\Messages\ExtractLogicalMessagesBehavior.cs 中的 NServiceBus.Unicast.Messages.ExtractLogicalMessagesBehavior.Invoke(ReceivePhysicalMessageContext context, Action next):NServiceBus.Pipeline.BehaviorChain 的第 56 行1.Invoke() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 35 at NServiceBus.Sagas.RemoveIncomingHeadersBehavior.Invoke(ReceivePhysicalMessageContext context, Action next) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Sagas\RemoveIncomingHeadersBehavior.cs:line 23 at NServiceBus.Pipeline.BehaviorChain
1.Invoke() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:第 35 行 NServiceBus.Unicast.Behaviors.RaiseMessageReceivedBehavior.Invoke(ReceivePhysicalMessageContext context, Action next) in c:\ BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Unicast\Behaviors\RaiseMessageReceivedBehavior.cs:第 18 行在 NServiceBus.Pipeline.BehaviorChain1.Invoke() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 35 at NServiceBus.MessageMutator.ApplyIncomingTransportMessageMutatorsBehavior.Invoke(ReceivePhysicalMessageContext context, Action next) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\MessageMutator\ApplyIncomingTransportMessageMutatorsBehavior.cs:line 22 at NServiceBus.Pipeline.BehaviorChain
1.Invoke() 在 c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Pipeline \BehaviorChain.cs:第 35 行 NServiceBus.UnitOfWork.UnitOfWorkBehavior.Invoke(ReceivePhysicalMessageContext context, Action next) 在 c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\UnitOfWork\UnitOfWorkBehavior.cs:第 34 行 NServiceBus.Pipeline .行为链1.Invoke() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 35 at NServiceBus.Unicast.Behaviors.ForwardBehavior.Invoke(ReceivePhysicalMessageContext context, Action next) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Unicast\Behaviors\ForwardBehavior.cs:line 24 at NServiceBus.Pipeline.BehaviorChain
1.Invoke() 在 c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:第 35 行 NServiceBus.Audit.AuditBehavior.Invoke(ReceivePhysicalMessageContext context, Action next) in c:\BuildAgent\ work\1b05a2fea6e4cd32\src\NServiceBus.Core\Audit\AuditBehavior.cs:第 17 行 NServiceBus.Pipeline.BehaviorChain1.Invoke() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 35 at NServiceBus.Unicast.Behaviors.ImpersonateSenderBehavior.Invoke(ReceivePhysicalMessageContext context, Action next) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Unicast\Behaviors\ImpersonateSenderBehavior.cs:line 37 at NServiceBus.Pipeline.BehaviorChain
1.Invoke() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Pipeline\BehaviorChain.cs :NServiceBus.Unicast.Behaviors.MessageHandlingLoggingBehavior.Invoke(ReceivePhysicalMessageContext context, Action next) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Unicast\Behaviors\MessageHandlingLoggingBehavior.cs 的第 35 行:NServiceBus.Pipeline 的第 21 行.行为链1.Invoke() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 35 at NServiceBus.Unicast.Behaviors.ChildContainerBehavior.Invoke(ReceivePhysicalMessageContext context, Action next) in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Unicast\Behaviors\ChildContainerBehavior.cs:line 17 at NServiceBus.Pipeline.BehaviorChain
1.Invoke() in c:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Pipeline\BehaviorChain.cs: 第 35 行 NServiceBus.Pipeline.PipelineExecutor.InvokeReceivePhysicalMessagePipeline() 在 c:\BuildAgent\work\1b05a2fea6e4cd32\src \NServiceBus.Core\Pipeline\PipelineExecutor.cs:C:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Unicast\UnicastBus.cs 中 NServiceBus.Unicast.UnicastBus.TransportMessageReceived(Object sender, TransportMessageReceivedEventArgs e) 的第 44 行: C:\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Unicast\Transport\TransportReceiver.cs 中 NServiceBus.Unicast.Transport.TransportReceiver.OnTransportMessageReceived(TransportMessage msg) 的第 1099 行:NServiceBus.Unicast.Transport.TransportReceiver 的第 439 行c中的.ProcessMessage(TransportMessage消息):\BuildAgent\work\1b05a2fea6e4cd32\src\NServiceBus.Core\Unicast\Transport\TransportReceiver.cs:356 行
有趣的是,我更改了“xpto.Contracts”签名,它不再具有 PublicKeyToken=6a17a7d57c13b3cf',找不到对该密钥令牌的任何引用。这是从哪里来的?