Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resign manifest of click-once application change from 4.0 to 4.5

Tags:

clickonce

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 INFO Windows : 6.2.9200.0 (Win32NT) Common Language Runtime : 4.0.30319.34011 System.Deployment.dll : 4.0.30319.33440 built by: FX45W81RTMREL clr.dll : 4.0.30319.34011 built by: FX45W81RTMGDR dfdll.dll : 4.0.30319.33440 built by: FX45W81RTMREL dfshim.dll : 6.3.9600.16384 (winblue_rtm.130821-1623)

SOURCES Deployment url : http://www.xxxxxx.net/test/uploadtest/uploadtest.application Server : Microsoft-IIS/6.0 X-Powered-By : ASP.NET Application url : http://www.xxxxxx.net/test/uploadtest/Application%20Files/UploadTest_1_0_0_6/UploadTest.exe.manifest Server : Microsoft-IIS/6.0 X-Powered-By : ASP.NET

IDENTITIES Deployment Identity : UploadTest.application, Version=1.0.0.6, Culture=neutral, PublicKeyToken=835b72d8d08b5689, processorArchitecture=msil

APPLICATION SUMMARY * Installable application.

ERROR SUMMARY Below 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 SUMMARY No transaction error was detected.

WARNINGS There 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 DETAILS Following 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 DETAILS No transaction information is available.

like image 205
Alkampfer Avatar asked Oct 21 '22 11:10

Alkampfer


1 Answers

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.

like image 149
Alkampfer Avatar answered Oct 24 '22 01:10

Alkampfer