none
Troubleshooting "File [Filename], has a different computed hash than specified in manifest" RRS feed

  • Question

  • I get the "File [Filename], has a different computed hash than specified in manifest" in my ClickOnce installation and I need help troubleshooting the problem. I have searched both the forum and Internet in general without finding anything that helps me. I have tried the following (and many other things):

    • Publish from VS 2012 RC (.NET 4.0) wich succeeds, but with the problem of different computed hash when installing.
    • Publish from VS 2010 (.NET 4.0). Fails, stating that a project failed to build, but non of the projects fails to build. No idea why this is happening. I share the same solution- and project-files betwwen VS 2012 and VS 2010.
      UPDATE 2012-06-26: The project only fails to build when the project properties dialog is opened in VS. If I close it and right-click on the project and shoose "Publish..." and then "Finish" it succeeds to build, but with the problem of different computed hash when installing.
    • Publish from command prompt with msbuild (.NET 4.0) which succeeds, but with the problem of different computed hash when installing. I run the following comand:

      "MSBuild.exe /nologo /noconsolelogger "C:\[Path]\IRMA.sln" /m:1 /t:"Publish" /fl /flp:"logfile=d:\[Path]\IRMA.log;encoding=Unicode;verbosity=normal" /p:SkipInvalidConfigurations=true /p:ApplicationVersion=1.9.55.957 
      /p:PublishDir="d:\[PublishDir]" /p:InstallUrl=http://[url]/ /p:ProductName="IRMA Test" /p:OutDir="d:\[Outdir]\" /p:Configuration="EIOTest" /p:Platform="x86" /p:RunCodeAnalysis="False"

    In another post (http://social.msdn.microsoft.com/forums/en-US/winformssetup/thread/92ef0ad2-532a-41f1-ae11-3addbe9f0434) I found sample code to show the Hash of the file and when running that on my file it shows another hash than the hash in the manifest file. I don't change the file after publish (not that I am aware of anyway). The only thing that are a little bit unusual is that I use SlowCheetah XML Transformations to manipulate the config-file, but it is the exe-file that gets the different computed hash problem.

    I have tried to make sure that the folders are empty to force the publish to regenerate the manifest, but that does not seem to help.

    I would prefere to not use Mage and I can't see any real reason to why I should since VS should be able to publish the project. I have used ClickOnce from within VS in many projects before and I have never had a similar problem before.

    Thanks, Eric


    Eric Quist


    • Edited by Eric Quist Tuesday, June 26, 2012 8:54 AM Added details VS 2010 failing to publish.
    Monday, June 25, 2012 9:14 AM

All replies

  • Hi Eric,

    A common cause of this issue is that you changed the contents but the manifest doesn't update. You need to regenerate the manifest.

    You might can try the following way.

    1. clean the build, delete all the content in the output folder, then build and publish the application.

    2. http://social.msdn.microsoft.com/Forums/en-US/lightswitch/thread/15a1b994-9673-4265-b399-15e1aa884a4e/

    3. http://blogs.msdn.com/b/gauravb/archive/2008/10/06/clickonce-filename-has-a-different-computed-hash-than-specified-in-manifest.aspx

    4. use Mage.exe or MageUI.exe to regenerate the manifes, see http://msdn.microsoft.com/en-us/library/acz3y3te.aspx

    In addition, what' the error message when it publish from Visual studio 2010?

    Best Regards,


    Bob Wu [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, June 27, 2012 2:49 AM
    Moderator
  • Hi

    I have just solved the problem by creating the project-file from scratch again (in VS 2010 and MSBuild), but I have no real idea of why that solved the problem (aka what difference in the project file solved the problem). One thing that is different is that I haven't opened the new project file in VS 2012 RC yet, if that could be part of the problem?

    I still have the problem when doing the build with TFS Build though, but I haven't looked into that so much yet.

    I have tried both 1 & 3 and many of the scenarios in 2 without succees. I haven't used Mage and I would prefer to not use it if I don't have too.

    Regarding the problem when publishing in VS 2010 with the project properties dialog opened (doesn't matter how I publish as long as the window is open) I don't get much of an error at all. To my suprise it cleans the Ouput window and just says:

    "Building IRMA ...
    Error: Cannot publish because a project failed to build."


    Eric Quist


    • Edited by Eric Quist Wednesday, June 27, 2012 7:44 AM Corrected a misspelled word.
    Wednesday, June 27, 2012 7:43 AM
  • Hi,

    For the problem where you get the error that you can't publish it because it won't build, this happens when you have VS extensions such as Dev Express installed. Try using the Build menu/Publish option in Visual studio instead of using the Publish tab on the project properties. This uses msbuild directly. Using the Publish button on the Publish tab takes a different route through Visual Studio, and having extensions installed can cause a race condition so it tries to pubish before it finishes building, so it thinks it didn't build.

    For the hash problem, this is usually caused by someone messing with the files after publishing them, and not re-signing the manifest files. Maybe when you rebuilt the project, your second version has some difference in how the referenced assemblies are included. I would make sure the Cheetah software isn't changing any of the files after you publish. You can do post-build commands in VS or msbuild, and those will take place *after*  building, but *before* creating the deployment files, if you need to do something to the files outside of VS.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev


    Thursday, June 28, 2012 6:48 AM
    Moderator
  • Hi,

    I also noticed that it works when using Publish (from build menu or right-clicking the project).

    I do understand the theory about something changing the file after publishing, but the question is how to debug what is changing the file? It is deffinately not someone since the problem only exists on the build server now (and it wasn't someone in the original question either, since it got solved by re-creating the project file).

    My build script is based on the default template in TFS Build 2010 and what I have done is to copy the Build task and do it twice, but the second time with Publish as target. I have now changed so that the two builds is done in different folders, but that did not solve the problem. I have also checked that the hash of the exe-file in the build out put folder and the exe.deploy-file in the publish folder is equal, but it is wrong in the manifest-file in both folders.

    SlowCheetah (http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5) is the generalized web.config transform extension which should have both ClickOnce and CI support and it works perfectly fine in local builds. I don't see how that can effect the hash-problem? Do you mean that the transformation of the app.config file to *.exe.config file can effect the hash for the *.exe file?


    Eric Quist

    Thursday, June 28, 2012 8:32 AM
  • Check the date/time stamps on the files and identify any that are created after the .application and/or .exe.manifest files.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev

    Friday, June 29, 2012 3:37 AM
    Moderator
  • I checked them, but I'm not sure how to interpret the result.

    Most of the files are created before or with the same timestamp, but there are som that have a timestamp +1 second. It seems to be files that have filenames that starts with charachters later in the alphabete than my exe.deploy and exe.manifest files. The .application file is created last. It looks like it is the same in the build ouput folder (as in the publish folder).


    Eric Quist

    Friday, June 29, 2012 8:14 AM
  •  I have also checked that the hash of the exe-file in the build out put folder and the exe.deploy-file in the publish folder is equal, but it is wrong in the manifest-file in both folders.

    Hi Eric,

    Most likely the file has been changed by something.

    According to the description, SlowCheetah doesn't do anything to exe file. Does the hash of the config file is same to the hash recorded in the manifest? 

    What's the file name in the error message?

    In addition, do you mean it works when you publish with Visual studio by failed with the TFS?

    Best Regards,


    Bob Wu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, July 2, 2012 1:28 PM
    Moderator
  • Take away the assumption that it's actually the .exe file causing the problem.

    When does the Slow Cheetah software do whatever it's doing? Is it a post-build command, or part of the deployment script, or what?

    If you publish the application with Visual Studio, does it work?

    If you publish the application w/o Slow Cheetah, does it work?

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev

    Wednesday, July 4, 2012 10:57 PM
    Moderator
  • Sorry for the dealyed answer, but I have been on vaccation for a week.

    I have now checked all hashes of all files and all are correct in the manifest, except for the exe file. The error message also has the exe-file name.

    After recreating (earlier) the project file (and without opening it in VS 2012 RC) publishing from Visual Studio works as expected, aka the correct hash is written in the manifest file also for the exe file. When I do the same from my TFS Build it writes the wrong hash in the manifest file.


    Eric Quist

    Sunday, July 8, 2012 2:52 PM
  • Slow Cheetah has its own targets-file which is imported by the csproj file. I'm no msbuild expert, but from my understanding it depends on that the app.config copying has happended and for click once publish it does its thing before _DeploymentComputeClickOnceManifestInfo.

    It does work when publishing in Visual Studio.

    It doesn't work with TFS Build even if I remove Slow Cheetah so I think I have eliminated that as the potential source of the problem.

    Thanks, Eric


    Eric Quist

    Sunday, July 8, 2012 3:21 PM
  • Are you trying to publish it with msbuild on the same computer you have VS2012 installed on?

    Opening it in VS2012 is not what would cause the problem. Installing VS2012 is what could cause the problem. That upgrades .NET 4 to .NET 4.5.

    Can you try building it a computer that has never has VS2012 or .NET 4.5 installed on it?

    Can you please post a bug on connect.microsoft.com and post the link to it here? If you do that, I'll send it to a ClickOnce guy at Microsoft.

    RobinDotNet


    Click here to visit my ClickOnce blog!
    Microsoft MVP, Client App Dev

    Monday, July 9, 2012 4:59 AM
    Moderator
  • It works perfectly fine when I publish it with msbuild or VS 2010 on my computer, where VS 2012 RC is installed.

    I do suspect that my original project file that wasn't able to publish locally might have been modified in some way that caused it to get the wrong hash also on the local build. But after creating a new project file in VS 2010 and not opening it in VS 2012 RC I don't have any problem publishing locally anymore.

    Our build server does not have .NET 4.5 and VS 2012 installed, but that build still fails with the wrong hash in the manifest.

    Thanks for all your effort to help me!

    /Eric


    Eric Quist

    Monday, July 9, 2012 11:25 AM
  • Our build server does not have .NET 4.5 and VS 2012 installed, but that build still fails with the wrong hash in the manifest.

    Hi Eric,

    May be you should try them on your server.

    Best regards,


    Bob Wu [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, July 11, 2012 9:55 AM
    Moderator
  • I still have vaccation and I will continue to have that until mid august, just so you know. I appreciate your help a lot, but I won't be able to spend a lot of time with this until I'm back at work.

    I don't see installing .NET 4.5 on our build server as an acceptable approach, at least not until it is RTM.

    Thanks again and I guess I might be better off to start a new thread in august which is more focused on the build server problem if I can't find a solution to it.

    /Eric


    Eric Quist

    Saturday, July 14, 2012 9:17 PM
  • Thanks again and I guess I might be better off to start a new thread in august which is more focused on the build server problem if I can't find a solution to it.

    Hi Eric,

    You're welcome.

    If you still don't find a solution, welcome back and start a new thread on this issue.

    Good day.



    Bob Wu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, July 16, 2012 8:29 AM
    Moderator
  • Them problem is back and the project that I recreated before summer has now been opened in VS 2012 and I can't get a publish with a valid file hash.

    I posted a bug on connect: https://connect.microsoft.com/VisualStudio/feedback/details/766169/clickonce-publish-results-in-invalid-file-hash-with-vs2012-and-net-4-5

    Thanks, Eric


    Eric Quist

    Thursday, October 4, 2012 7:42 PM