Ok, you have probably landed here because you are trying to update your ClickOnce deployment but gets the error “application identity.manifest, has a different computed hash than specified in manifest.” .
In my case the reason was that I had done the wrong order when building the deployment.
Short version
I didn’t sign my manifest and application file in the right order. What I did was (in a command prompt with admin rights):
cls
cd C:\inetpub\ClickOnce_DynamicsNAV80_Instance1_at_SERVERNAME.cloudapp.net\Deployment\ApplicationFiles
c:\remote\mage.exe -Update Microsoft.Dynamics.Nav.Client.exe.manifest -FromDirectory .\
cd..
c:\Remote\mage.exe -update Microsoft.Dynamics.Nav.Client.application -appmanifest ApplicationFiles\Microsoft.Dynamics.Nav.Client.exe.manifest -appcodebase ApplicationFiles/Microsoft.Dynamics.Nav.Client.exe.manifest
c:\Remote\mage.exe -sign ApplicationFile/Microsoft.Dynamics.Nav.Client.exe.manifest -certfile C:\Remote\Certificate\DynamicsNAV80.pfx -pwd PASSWORD
c:\Remote\mage.exe -sign Microsoft.Dynamics.Nav.Client.application -certfile C:\Remote\Certificate\DynamicsNAV80.pfx -pwd PASSWORD
It looks like when I update the application file it calculates some sort of hash value from the manifest file to use to be able to compare if it is using the right version. And when I sign my manifest file it will add signature data to the manifest file meaning that it will contain other data than the data the application based its hash sum on. Thus, the next time the application file will check if the manifest is the one it is based one it will give a fail (“File, ClickOnce_DynamicsNAV80_Instance1_at_SERVERNAME.cloudapp.net application identity.manifest, has a different computed hash than specified in manifest.”) since the manifest file has changed since the update.
So instead, I changed the order. I first updated the manifest, then I signed it. Then I did the same with application file.
cls
cd C:\inetpub\ClickOnce_DynamicsNAV80_Instance1_at_SERVERNAME.cloudapp.net\Deployment\ApplicationFiles
c:\remote\mage.exe -Update Microsoft.Dynamics.Nav.Client.exe.manifest -FromDirectory .\
c:\Remote\mage.exe -sign Microsoft.Dynamics.Nav.Client.exe.manifest -certfile C:\Remote\Certificate\DynamicsNAV80.pfx -pwd PASSWORD
cd..
c:\Remote\mage.exe -update Microsoft.Dynamics.Nav.Client.application -appmanifest ApplicationFiles\Microsoft.Dynamics.Nav.Client.exe.manifest -appcodebase ApplicationFiles/Microsoft.Dynamics.Nav.Client.exe.manifest
c:\Remote\mage.exe -sign Microsoft.Dynamics.Nav.Client.application -certfile C:\Remote\Certificate\DynamicsNAV80.pfx -pwd PASSWORD
Now it worked!
Long Version
My deployment is a web deployment that I have done via the 1VM/2VM script. My installation folder is located according to following structure:
C:\inetpub\ClickOnce_DynamicsNAV80_Instance1_at_<SERVERNAME>.cloudapp.net\Deployment\ApplicationFiles
The mage.exe file is located in C:\Remote (copied there by the 1VM/2VM script). Otherwise you can probably find it here:
Windows 7 SDK :C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools\mage.exe
Windows 8 SDK: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\mage.exe
Windows 8.1 SDK: C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\mage.exe
My certificate is located: C:\Remote\Certificate\DynamicsNAV80.pfx (I have put it there myself). If you don’t have a certificate then read How to: Create Your Own Test Certificate on msdn.
Now we have all the pieces. Time do following things in the right order:
- Update the manifest
- Sign the manifest
- Update the application file
- Sign the application file
Open a command prompt with admin rights and type:
cls
cd C:\inetpub\ClickOnce_DynamicsNAV80_Instance1_at_SERVERNAME.cloudapp.net\Deployment\ApplicationFiles
c:\remote\mage.exe -Update Microsoft.Dynamics.Nav.Client.exe.manifest -FromDirectory .\
c:\Remote\mage.exe -sign Microsoft.Dynamics.Nav.Client.exe.manifest -certfile C:\Remote\Certificate\DynamicsNAV80.pfx -pwd PASSWORD
cd..
c:\Remote\mage.exe -update Microsoft.Dynamics.Nav.Client.application -appmanifest ApplicationFiles\Microsoft.Dynamics.Nav.Client.exe.manifest -appcodebase ApplicationFiles/Microsoft.Dynamics.Nav.Client.exe.manifest
c:\Remote\mage.exe -sign Microsoft.Dynamics.Nav.Client.application -certfile C:\Remote\Certificate\DynamicsNAV80.pfx -pwd PASSWORD
Now it worked!
More useful links
Deploying Microsoft Dynamics NAV Using ClickOnce on msdn.
NAV 2013 and ClickOnce Install – on Gunnars Blog.
komaan
2015-06-03 at 07:37
Wow, amazing blog layout! How lengthy have you ever been blogging for?
you make blogging look easy. The overall glance of your website is excellent, as neatly as the content material!
LikeLike
Alex
2015-12-14 at 06:04
very nice blog post. Can i ask something if you know?
I have this problem only in one user, all the other users don’t experience the same thing
LikeLike