ClickOnce 和 NServiceBus? “清单中的引用与下载的程序集 NServiceBus.Host.exe 的标识不匹配。”
我该如何补救?我是否需要使用此处描述的清单设置从源代码构建 NSB:http: //geekswithblogs.net/rakker/archive/2007/12/06/117449.aspx?
ERROR DETAILS
Following errors were detected during this operation.
* [8/16/2011 2:26:17 PM] System.Deployment.Application.InvalidDeploymentException (RefDefValidation)
- Reference in the manifest does not match the identity of the downloaded assembly NServiceBus.Host.exe.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
How do I remedy this? Do I need to build NSB from source with the Manifest settings described here: http://geekswithblogs.net/rakker/archive/2007/12/06/117449.aspx?
ERROR DETAILS
Following errors were detected during this operation.
* [8/16/2011 2:26:17 PM] System.Deployment.Application.InvalidDeploymentException (RefDefValidation)
- Reference in the manifest does not match the identity of the downloaded assembly NServiceBus.Host.exe.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
at System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NServiceBus.Host.exe 用于单独运行端点,并提供将端点轻松安装为 Windows 服务的方法。
如果您尝试将 NServiceBus 嵌入到 Windows 窗体应用程序中,则 WinForms exe 需要作为“主机”。不要引用 NServiceBus.Host.exe。仅引用 NServiceBus.dll 和 NServiceBus.Core.dll。 (也可能是 log4net.dll。)
在 WinForms 应用程序启动时,您需要手动初始化总线,如此处所述。
这至少是在 Windows 窗体应用程序中使用 NServiceBus 的一般模式。我还没有专门尝试过使用 ClickOnce 发布类似的应用程序。我不确定 ClickOnce 是否可以处理 MSMQ 依赖项。
NServiceBus.Host.exe is for running an endpoint all by itself, and provides the means to easily install an endpoint as a Windows service.
If you are trying to embed NServiceBus within a Windows Forms app, then the WinForms exe needs to be the "host". Do not reference NServiceBus.Host.exe. Only reference NServiceBus.dll and NServiceBus.Core.dll. (And log4net.dll probably as well.)
Within the startup of your WinForms app, you will need to manually initialize the Bus, as described here.
This, at least, is the general pattern for using NServiceBus within a Windows Forms app. I have not specifically tried releasing an app like that with ClickOnce. I'm not sure if ClickOnce can take care of the MSMQ dependency or not.