我该如何解决这个问题?我是否需要使用此处所述的清单设置从源代码构建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)
答案 0 :(得分:2)
NServiceBus.Host.exe用于单独运行端点,并提供了将端点轻松安装为Windows服务的方法。
如果您尝试在Windows窗体应用程序中嵌入NServiceBus,则WinForms exe需要是“主机”。不要引用NServiceBus.Host.exe。仅引用NServiceBus.dll和NServiceBus.Core.dll。 (还有log4net.dll。)
在WinForms应用的启动过程中,您需要manually initialize the Bus, as described here。
这至少是在Windows窗体应用程序中使用NServiceBus的一般模式。我没有特别尝试使用ClickOnce发布类似的应用程序。我不确定ClickOnce是否可以处理MSMQ依赖关系。