Clickonce signed application fails with "has a different computed hash than specified in manifest". Mage fails to resolve issue

TheFIXGuy picture TheFIXGuy · Mar 18, 2014 · Viewed 23.9k times · Source

I've been really struggling with this one for days. I've seen other posts like ClickOnce Deployment Error: different computed hash than specified in manifest, but the solutions do not seem to work for me.

I have a valid code signing certificate, and have been using it to sign my ClickOnce application for months. I realized I wasn't signing the executable and dlls themselves, so I attempt to do so. Now every time I publish and run the setup.exe, it fails with: "File, xxxxxx.dll, has a different computed hash than specified in manifest."

If I do not sign the exe and Dlls, I can redeploy. I made sure all copies of the exe/dlls are signed in all directories (Target, Obj) before publishing. I've tried using Mage/MageUI but have had no success. Is it possible to configure a ClickOnce install without signed code, then publish signed code? Seems logical, but perhaps I am missing something.

Thanks, Gregg

Answer

Charles picture Charles · Mar 21, 2014

Is there any chance you are trying to deploy a WPF application and using Visual Studio 2012 or later? If so, you have to use the "AfterCompile" setting in your project file to sign the application, or you end up with the hash mismatch.

See this stackoverflow post: SignTool Not Signing ClickOnce App Using SHA256, Only Uses SHA1

Which links to Robin's excellent blog solution: http://robindotnet.wordpress.com/2013/04/14/windows-8-and-clickonce-the-definitive-answer-revisited/