解决 ClickOnce 发布出现: 清单中的引用与下载的程序集 *exe 的标识不匹配 有关问题

解决 ClickOnce 发布出现: 清单中的引用与下载的程序集 *.exe 的标识不匹配 问题

平台版本信息
Windows : 6.1.7601.65536 (Win32NT)
Common Language Runtime : 4.0.30319.17929
System.Deployment.dll : 4.0.30319.17929 built by: FX45RTMREL
clr.dll : 4.0.30319.17929 built by: FX45RTMREL
dfdll.dll : 4.0.30319.17929 built by: FX45RTMREL
dfshim.dll : 4.0.31106.0 (Main.031106-0000)



部署 URL : http://192.168.1.172/XSMainApp.application
服务器 : Microsoft-IIS/7.5
X-Powered-By : ASP.NET
应用程序 URL : http://192.168.1.172/Application%20Files/XSMainApp_1_1_0_6/XSMainApp.exe.manifest
服务器 : Microsoft-IIS/7.5
X-Powered-By : ASP.NET


标识
部署标识 : XSMainApp.application, Version=1.1.0.6, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil
应用程序标识 : XSMainApp.exe, Version=1.1.0.6, Culture=neutral, PublicKeyToken=0000000000000000, processorArchitecture=msil, type=win32


应用程序摘要
* 可安装的应用程序。


错误摘要
以下是错误摘要,这些错误的详细信息列在该日志的后面。
* 激活 http://192.168.1.172/XSMainApp.application 导致异常。 检测到下列失败消息:
+ 清单中的引用与下载的程序集 Common.AutoUpdater.exe 的标识不匹配。


组件存储事务失败摘要
未检测到任何事务错误。


警告
* 此应用程序清单无签名。签名验证将被忽略。
* 此应用程序清单无签名。签名验证将被忽略。


操作进度状态
* [2014-04-01 11:33:32] : 已启动 http://192.168.1.172/XSMainApp.application 的激活过程。
* [2014-04-01 11:33:33] : 部署清单处理已成功完成。
* [2014-04-01 11:33:33] : 已启动应用程序的安装过程。
* [2014-04-01 11:33:33] : 应用程序清单处理已成功完成。
* [2014-04-01 11:33:35] : 已找到兼容运行时版本 4.0.30319。
* [2014-04-01 11:33:35] : 信任请求和平台检测已完成。


错误详细信息
执行此操作期间检测到下列错误。
* [2014-04-01 11:33:51] System.Deployment.Application.InvalidDeploymentException (RefDefValidation)
- 清单中的引用与下载的程序集 Common.AutoUpdater.exe 的标识不匹配。
- 源: System.Deployment
- 堆栈跟踪:
在 System.Deployment.Application.DownloadManager.ProcessDownloadedFile(Object sender, DownloadEventArgs e)
在 System.Deployment.Application.FileDownloader.DownloadModifiedEventHandler.Invoke(Object sender, DownloadEventArgs e)
在 System.Deployment.Application.FileDownloader.OnModified()
在 System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
在 System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
在 System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
在 System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification notification, DownloadOptions options)
在 System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
在 System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
在 System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
在 System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)


组件存储事务详细信息
没有可用的事务信息。

原因:

      主程序中引用了 Windows 应用程序的工程,并且这个工程没有没有设置 启用ClickOnce 安全设置。


解决办法:

  右击被引用工程属性----安全性---启用ClickOnce 安全设置。(打钩)