首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >调试时加载ServiceBus程序集失败

调试时加载ServiceBus程序集失败
EN

Stack Overflow用户
提问于 2013-06-21 18:07:23
回答 3查看 2.5K关注 0票数 0

我正在将azure服务总线功能实现到客户端asp.net webforms解决方案中。

工作者角色定期轮询总线以获取新消息,并为现有的webforms应用程序定义web角色,该角色负责将消息添加到总线队列中。

每当我尝试在本地运行应用程序时,我都会收到一个错误,因为Microsoft.ServiceBus程序集与预期的不匹配……

代码语言:javascript
运行
复制
 System.IO.FileLoadException was unhandled
  HResult=-2146234304
  Message=Could not load file or assembly 'Microsoft.ServiceBus, Version=2.0.0.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)
  Source=Azure.EnquiryWorker
  FileName=Microsoft.ServiceBus, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
  FusionLog==== Pre-bind state information ===
LOG: User = *Omitted*
LOG: DisplayName = Microsoft.ServiceBus, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///C:/Users/*path omitted*/*project name omitted*/csx/Debug/roles/Azure.EnquiryWorker/approot
LOG: Initial PrivatePath = C:\Users\*path omitted*/*project name omitted*\csx\Debug\roles\Azure.EnquiryWorker\approot
Calling assembly : Azure.EnquiryWorker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\*path omitted*/*project name omitted*\csx\Debug\roles\Azure.EnquiryWorker\approot\Azure.EnquiryWorker.dll.config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.ServiceBus, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/*path omitted*/*project name omitted*/csx/Debug/roles/Azure.EnquiryWorker/approot/Microsoft.ServiceBus.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

  StackTrace:
       at Azure.EnquiryWorker.WorkerRole.OnStart()
       at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
       at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRole(RoleType roleType)
       at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<InitializeRole>b__0()
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 

webforms应用程序的bin文件夹中有serviceBus dll (作为间接引用添加,因为服务总线代码驻留在库项目中)。

GAC不包含servicebus程序集,我的项目都引用servicebus dll的v2,并被设置为CopyLocal。

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2013-07-03 20:53:26

当我将Azure ServiceBus Nuget包更新到2.1版时,这个问题很方便地解决了。

票数 2
EN

Stack Overflow用户

发布于 2013-06-22 03:18:37

为了帮助调试,你能在你的本地机器上确认你的GAC中是否有Microsoft.ServiceBus.dll吗?还要检查该版本是否与您在项目中引用的版本不同。

票数 -1
EN

Stack Overflow用户

发布于 2013-06-24 01:32:52

您的项目似乎没有DLL,或者没有它的正确版本。构建应用程序并查看/bin文件夹。如果找到动态链接库(Microsoft.ServiceBus.dll),请检查其版本并确保其匹配(Version=2.0.0.0)。如果您找不到它,它可能在您的全局程序集缓存中。

如果这对您没有帮助,请尝试: 1.在引用属性中设置copylocal = true,以便将DLL复制到输出目录中。2.使用nuget包管理器链接到Microsoft.Servicebus动态链接库。它通常可以解决很多类似的问题。

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17232602

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档