RSS

Dynamics NAV ClickOnce: “File, FILENAME application identity.manifest, has a different computed hash than specified in manifest.”

18 Oct

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 SDKC:\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:

  1. Update the manifest
  2. Sign the manifest
  3. Update the application file
  4. 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.

 

Advertisements
 
1 Comment

Posted by on 2014-10-18 in Okategoriserade

 

Tags: , ,

One response to “Dynamics NAV ClickOnce: “File, FILENAME application identity.manifest, has a different computed hash than specified in manifest.”

  1. 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!

    Like

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Mark Brummel Blog | Microsoft Dynamics NAV

Master Classes Design Patterns and more...

Vjeko.com

ideas in the cloud

Goprowe AB

Reflections from the ERP field

ArcherPoint Developer Blog

Reflections from the ERP field

The NAV Viking´s Blog

- Sharing my experience in the Dynamics NAV world

Comments for waldo's blog

Reflections from the ERP field

Nav Can Be Fun

Its Really Fun to Work with Microsoft Dynamics Nav

Navision-Girl.Com

Reflections from the ERP field

LET'S TALK NAV

Tips, Tricks, How-To's & News about Microsoft Dynamics NAV & Dynamics 365 for Financials

Kine's Info

Reflections from the ERP field

blog.wibeck.org/

Just another WordPress.com site

NAV/SQL Performance - My Two Cents

Reflections from the ERP field

Hougaard.com – Applied Hacking

Reflections from the ERP field

Kauffmann @ Dynamics NAV

Reflections from the ERP field

Kriki’s Dynamics NAV blog

Reflections from the ERP field

Rashed Amini

Reflections from the ERP field

Olof Simren - Microsoft Dynamics NAV Blog

My blog about Microsoft Dynamic NAV tips and tricks. Remember to Subscribe!

Van Vugt's dynamiXs

Reflections from the ERP field

Navisionary – Dynamics NAV

Reflections from the ERP field

%d bloggers like this: