C# &引用;找不到程序集“;升级NServiceBus后

C# &引用;找不到程序集“;升级NServiceBus后,c#,asp.net,nservicebus,C#,Asp.net,Nservicebus,对于即将发布的版本,我们已经从NServiceBus 3.0.3升级到3.2.7。在本地或QA测试期间,我们没有遇到任何问题,但在登台环境中进行测试时,我们无法启动引用NServiceBus的IIS托管web服务 分段机使用与QA相同的软件;Windows 2008R2,IIS7.5 事件日志有两个错误。第一个是事件1026(.NET运行时) 应用程序:w3wp.exe框架版本:v4.0.30319说明: 由于未处理的异常,进程已终止。例外信息: NServiceBus.Unicast.Queu

对于即将发布的版本,我们已经从NServiceBus 3.0.3升级到3.2.7。在本地或QA测试期间,我们没有遇到任何问题,但在登台环境中进行测试时,我们无法启动引用NServiceBus的IIS托管web服务

分段机使用与QA相同的软件;Windows 2008R2,IIS7.5

事件日志有两个错误。第一个是事件1026(.NET运行时)

应用程序:w3wp.exe框架版本:v4.0.30319说明: 由于未处理的异常,进程已终止。例外信息: NServiceBus.Unicast.Queuing.FailedToSendMessageException堆栈:位于 NServiceBus.Unicast.Queuing.Msmq.MsmqMessageSender.NServiceBus.Unicast.Queuing.ISendMessages.Send(NServiceBus.Unicast.Transport.TransportMessage, N服务总线地址)在 NServiceBus.Unicast.UnicastBus.SendSubscribeMessageWithRetries(NServiceBus.Address, NServiceBus.Unicast.Transport.TransportMessage,System.String,Int32) 在 NServiceBus.Unicast.UnicastBus+c_DisplayClass8.b_7(System.Object) 位于的System.Threading.ExecutionContext.runTryCode(System.Object) System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, 清除代码,System.Object)位于 System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback,System.Object,布尔值)位于 System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem() 位于System.Threading.ThreadPoolWorkQueue.Dispatch()的 System.Threading.\u ThreadPoolWaitCallback.PerformWaitCallback()

接着是事件1326(ASP.NET 4.0.30319.0)

发生未处理的异常,进程终止

应用程序ID:DefaultDomain

进程ID:10180

异常:System.Runtime.Serialization.SerializationException

消息:找不到程序集的NServiceBus.Core,版本=3.2.0.0, 区域性=中性,PublicKeyToken=9fc386479f8a226c'

StackTrace:在 System.Runtime.Serialization.Formatters.Binary.BinarySassemblyInfo.GetAssembly() 在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinarySassemblyInfo assemblyInfo,字符串名称)位于 System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(字符串 objectName,String[]MemberName,BinaryTypeEnum[]binaryTypeEnumA, 对象[]类型信息A、Int32[]成员组件、ObjectReader objectReader、Int32 objectId、BinarySassemblyInfo assemblyInfo、, 尺寸阵列组件(可组装)位于 System.Runtime.Serialization.Formatters.Binary.\u BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped 记录)在 System.Runtime.Serialization.Formatters.Binary.\u BinaryParser.Run()
在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler 处理程序,\uuuu二进制解析器serParser,布尔fCheck,布尔 isCrossAppDomain,IMethodCallMessage methodCallMessage)位于 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(流) serializationStream,HeaderHandler处理程序,布尔fCheck,布尔 isCrossAppDomain,IMethodCallMessage methodCallMessage)位于 System.AppDomain.Deserialize(字节[]blob)位于 System.AppDomain.UnmarshalObject(字节[]blob)

我已经检查了bin文件夹,它们确实包含正确版本的NServiceBus.dll和NServiceBus.Core.dll(两者都是相同的版本,3.2.7)


我觉得很困惑,我想我已经检查过明显的事情了。可能是因为它试图加载多个版本的NServiceBus(即一些未更新的引用?)。然而,这应该已经是QA中的一个问题了?

虽然是一个老问题,但我遇到了这个问题,我有一个解决方法

首先。确保进程可以写入日志文件夹

接下来,检查流程正在查看的位置。就我而言,它只是在搜索
file:///c:/windows/system32/inetsrv/
所以我在那里添加了dll
NServiceBus.Core.dll
,现在我可以看到真正的问题了

我猜是在后台线程上发生了一个未处理的异常(第一个错误),该异常随后被序列化并传递给主线程,主线程试图对其进行反序列化,但找不到程序集(第二个错误)。第二个错误杀死了应用程序池,意味着我丢失了真正的错误

此解决方法仅解决第二个错误,而不是原始问题。话虽如此,到目前为止,这已经足够让我的应用程序再次工作,并找到真正的错误,对我来说是MSMQ内存不足。所以我重新启动了MSMQ,它已经开始工作了。然后我从新位置删除了
NServiceBus.Core.DLL
,应用程序仍在运行

记录输出:

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll

=== Pre-bind state information ===
LOG: User = IIS APPPOOL\TenBagsFull
LOG: DisplayName = NServiceBus.Core
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: NServiceBus.Core | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///c:/windows/system32/inetsrv/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = w3wp.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///c:/windows/system32/inetsrv/NServiceBus.Core.DLL.
LOG: Attempting download of new URL file:///c:/windows/system32/inetsrv/NServiceBus.Core/NServiceBus.Core.DLL.
LOG: Attempting download of new URL file:///c:/windows/system32/inetsrv/NServiceBus.Core.EXE.
LOG: Attempting download of new URL file:///c:/windows/system32/inetsrv/NServiceBus.Core/NServiceBus.Core.EXE.
LOG: All probing URLs attempted and failed.
Running under executable  c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows. 

虽然这是一个老问题,但我遇到了这个问题,我有一个解决办法

首先。确保进程可以写入日志文件夹

接下来,检查流程正在查看的位置。就我而言,它只是在搜索
file:///c:/windows/system32/inetsrv/
所以我在那里添加了dll
NServiceBus.Core.dll
,现在我可以看到真正的问题了

我猜是在后台线程上发生了一个未处理的异常(第一个错误),该异常随后被序列化并传递给主线程,主线程试图对其进行反序列化,但找不到程序集(第二个错误)。第二个错误杀死了应用程序池,意味着我丢失了真正的错误

此解决方法仅解决第二个错误,而不是原始问题。话虽如此,到目前为止,这已经足够让我的应用程序再次工作,并找到真正的错误,对我来说是MSMQ内存不足。所以我重新启动了MSMQ,它已经开始工作了。然后我从新位置删除了
NServiceBus.Core.DLL
,应用程序仍在运行

记录输出:

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll

=== Pre-bind state information ===
LOG: User = IIS APPPOOL\TenBagsFull
LOG: DisplayName = NServiceBus.Core
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: NServiceBus.Core | Domain ID: 1
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///c:/windows/system32/inetsrv/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = w3wp.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///c:/windows/system32/inetsrv/NServiceBus.Core.DLL.
LOG: Attempting download of new URL file:///c:/windows/system32/inetsrv/NServiceBus.Core/NServiceBus.Core.DLL.
LOG: Attempting download of new URL file:///c:/windows/system32/inetsrv/NServiceBus.Core.EXE.
LOG: Attempting download of new URL file:///c:/windows/system32/inetsrv/NServiceBus.Core/NServiceBus.Core.EXE.
LOG: All probing URLs attempted and failed.
Running under executable  c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows. 

我们今天遇到了这个错误,我们的融合日志输出实际上与post中的条目完全相同