问题描述
我在.NET 4.0中有一个项目,该项目通过单击一次发布在本地共享文件夹中进行测试。一旦测试通过,我们将使用mage.exe退出清单,并使用生产最终URL更改发布URL。 ....
如果我们使用.NET 4.0,一切都会正常。
如果我们使用.NET 4.5及更高版本,则当我们尝试从最终URL启动应用程序时,它将无法安装并出现以下错误。
我的问题是:
在.NET 4.5中,我应该如何使用mage.exe更改应用程序的发布URL(并使用新密钥退出),而从4.0所做的一切正常运行?
平台版本信息
Windows:6.2.9200.0(Win32NT)
公共语言运行时
:4.0.30319.34011
系统.Deployment.dll
:4.0.30319.33440构建:FX45W81RTMREL
clr.dll:4.0.30319.34011构建:FX45W81RTMGDR
dfdll.dll:4.0.30319.33440构建:FX45W81RTMREL
dfshim.dll:6.3.9600.16384(winblue_rtm.130821- 1623)
源
部署网址
:
服务器:Microsoft-IIS / 6.0
X-Powered-By: ASP.NET
应用程序URL
:
服务器:Microsoft-IIS / 6.0
X-Powered-By :ASP.NET
IDENTITIES
部署身份
:UploadTest.application,版本= 1.0.0.6,Culture = neutral,PublicKeyToken = 835b72d8d08b5689,processorArchitecture = msil
应用摘要
*可安装的应用。
错误摘要
下面是错误摘要,这些错误的详细信息在日志的后面列出。
*激活导致异常。检测到以下失败消息:
+应用程序清单的计算哈希值与指定的哈希值不同或完全没有指定哈希值。
+文件UploadTest.exe.manifest的计算哈希值与清单中指定的值不同。
组件存储交易失败摘要
没有交易错误被检测到。
警告
此操作期间没有警告。
操作进度状态
* [04/04/2014 11:12:05]:激活已启动。
* [04/04/2014 11:12:06]:部署清单的处理已成功完成。
* [04/04/2014 11:12:06]:该应用程序的安装已开始。
错误详细信息
检测到以下错误在此操作期间。
* [04/04/2014 11:12:06] System.Deployment.Application.InvalidDeploymentException(HashValidation)
-应用程序清单的计算哈希值与指定的哈希值不同或完全没有指定的哈希值。
-来源:System.Deployment
-堆栈跟踪:System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest,String targetDir,Uri deploymentUri,IDownloadNotification通知,DownloadOptions选项,Uri&在System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest DeploymentManifest,字符串targetDir,Uri deploymentUri,Uri& appSourceUri,String& appManifestPath)中的
在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,字符串tex tualSubId,字符串deploymentProviderUrlFromExtension,BrowserSettings browserSettings,String& errorPageUrl)
在System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(对象状态)
-内部异常---
System.Deployment.Application.InvalidDeploymentException(HashValidation)
-文件UploadTest.exe.manifest具有与清单中指定的不同的计算哈希值。
-来源:System.Deployment
-堆栈跟踪:System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath,Hash hash)在System.Deployment.Application处为
。 ComponentVerifier.VerifyFileHash(String filePath,HashCollection hashCollection)
在System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest,String targetDir,Uri deploymentUri,IDownloadNotification通知,DownloadOptions选项,Uri& appSourceUri,String& appManifestPath ) p>
组件存储交易详细信息
没有可用的交易信息。
我终于解决了,原来问题出在使用mage.exe工具。
当我使用mage.exe退出应用程序时,如果应用程序在.NET 4.5或更高版本中,我需要指定使用SHA256RSA,并选择
-a sha256RSA
在mage.exe命令林中e,一切正常。
I've a project in .NET 4.0 that is published with click-once in local shared folder for testing. Once the testing passed we use mage.exe to resign the manifest and change publishing url with production final url http://www.ourcompany.net/....
Everything works if we use .NET 4.0.
If we use .NET 4.5 and above, when we try to start application from the final url it fails to install with the error below.
My question is:
How should I use mage.exe to change the publication url of the application (and resign with a new key) with .NET 4.5, what is changed from 4.0 where everything works correctly?
PLATFORM VERSION INFOWindows : 6.2.9200.0 (Win32NT)Common Language Runtime: 4.0.30319.34011System.Deployment.dll: 4.0.30319.33440 built by: FX45W81RTMRELclr.dll : 4.0.30319.34011 built by: FX45W81RTMGDRdfdll.dll : 4.0.30319.33440 built by: FX45W81RTMRELdfshim.dll : 6.3.9600.16384 (winblue_rtm.130821-1623)
SOURCESDeployment url: http://www.xxxxxx.net/test/uploadtest/uploadtest.applicationServer : Microsoft-IIS/6.0X-Powered-By : ASP.NETApplication url: http://www.xxxxxx.net/test/uploadtest/Application%20Files/UploadTest_1_0_0_6/UploadTest.exe.manifestServer : Microsoft-IIS/6.0X-Powered-By : ASP.NET
IDENTITIESDeployment Identity: UploadTest.application, Version=1.0.0.6, Culture=neutral, PublicKeyToken=835b72d8d08b5689, processorArchitecture=msil
APPLICATION SUMMARY* Installable application.
ERROR SUMMARYBelow is a summary of the errors, details of these errors are listed later in the log.* Activation of http://www.xxxxxx.net/test/uploadtest/uploadtest.application resulted in exception. Following failure messages were detected:+ Application manifest has either a different computed hash than the one specified or no hash specified at all.+ File, UploadTest.exe.manifest, has a different computed hash than specified in manifest.
COMPONENT STORE TRANSACTION FAILURE SUMMARYNo transaction error was detected.
WARNINGSThere were no warnings during this operation.
OPERATION PROGRESS STATUS* [04/04/2014 11:12:05] : Activation of http://www.xxxxxx.net/test/uploadtest/uploadtest.application has started.* [04/04/2014 11:12:06] : Processing of deployment manifest has successfully completed.* [04/04/2014 11:12:06] : Installation of the application has started.
ERROR DETAILSFollowing errors were detected during this operation.* [04/04/2014 11:12:06] System.Deployment.Application.InvalidDeploymentException (HashValidation)- Application manifest has either a different computed hash than the one specified or no hash specified at all.- Source: System.Deployment- Stack trace:at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, Uri& appSourceUri, String& appManifestPath)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)--- Inner Exception ---System.Deployment.Application.InvalidDeploymentException (HashValidation)- File, UploadTest.exe.manifest, has a different computed hash than specified in manifest.- Source: System.Deployment- Stack trace:at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, Hash hash)at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, HashCollection hashCollection)at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
COMPONENT STORE TRANSACTION DETAILSNo transaction information is available.
I've finally solved, the problems turns out to be using wrong sha with mage.exe tools.
When I resign my application with mage.exe, if the application is in .NET 4.5 or above I need to specify to use SHA256RSA with the option
-a sha256RSA
in mage.exe command line and everything works.
这篇关于单击一次应用程序的退出清单从4.0更改为4.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!