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.

 

 
2 Comments

Posted by on 2014-10-18 in Okategoriserade

 

Tags: , ,

2 responses 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

     
  2. 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

    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 )

Facebook photo

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

Connecting to %s

 
The BC Docs Librarian

Tips and news for AL programmers

Stefan Maroń

Dynamics 365 Business Central

James Pearson

Thoughts about Dynamics 365 Business Central, Git, Azure DevOps, PowerShell, Automated Testing, Visual Studio Code...and maybe some other stuff

Roberto Stefanetti BLOG

MVP & MCT Microsoft Dynamics 365 Business Central, Powershell, Azure, SQL Server

JoeBrown

DevOps starts with culture!

Comments for DevOps ABCs Blog

Reflections from the ERP field

DevOps ABCs Blog

Reflections from the ERP field

Dynamics 365 Business Central for Partners

Reflections from the ERP field

Freddys blog

Learn something new... - then Teach someone!

Stefano Demiliani Technical Blog

Reflections from the ERP field

David Worthington's NAV Performance Blog

Micosoft Dynamics NAV Performance Testing & Optimization

Freddys Blog

Reflections from the ERP field

Marije Brummel Blog | Business Central, Azure and more...

Design Patterns, Performance, Clean Code

Vjeko.com

Ideas in the cloud

Goprowe AB

Reflections from the ERP field

ArcherPoint

Reflections from the ERP field

The NAV Viking´s Blog

- Sharing my experience in the Dynamics NAV world

Comments for

Reflections from the ERP field

Nav Can Be Fun

Its Really Fun to Work with Microsoft Dynamics Nav / D365 Business Central

%d bloggers like this: