MSBuild Click-Once issues with manifest

浪子不回头ぞ 提交于 2019-12-23 16:49:04

问题


I am getting the following error when I publish my ClickOnce application with MSBuild. I have a pre-publish task which copys the correct app.config file into the project before the publish and this is the only thing that I think could be causing this error. How can I correct this?

Following failure messages were detected: File, MyApplication.exe.config, has a different computed hash than specified in manifest.


回答1:


You're copying the file after the hash is generated.

You need to copy the file during BUILD and before PUBLISH. The ClickOnce mechanism thinks there is tampering going on.




回答2:


Brett's answer is correct, the GenerateManifests target gets run in the middle of the CoreBuild target (in Microsoft.Common.targets) so the best place to update the build file is in BeforeBuild.

I'm guessing the reason you are switching the app.config is to replace the config with one that has the right values for the environment you are publishing too? If that is the case have a read of my posting on publishing to multiple environments...will help to answer questions like 'how do I override the BeforeBuild target?'.




回答3:


Sign the click-once manifists and (re)create a Test Certificate for you application under the signing tab in the project properties... This solved the problem for me. Good Luck



来源:https://stackoverflow.com/questions/1725460/msbuild-click-once-issues-with-manifest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!