Weird behaviour of the app.config deployment after updating it

I moved some hardcoded settings to a custom Section (so I did not use the <appSetting> tag) in the app.config of my ClickOnce application. When updating, the clients got an error stating that the server gave a 404 not found error for the file "myapp.exe.config.deploy". Browsing on the server I did find the changed app.config there, only it was named app.config.deploy.

Thinking to be smart I renamed the app.config to myapp.exe.config on the development machine and published again. That did not work... However after naming the file back to app.config and publishing the error went away and the clients used the setting happily!

Please explain what went wrong?


In the properties of the app.config I had set the build action to Content and the Copy to outputdirectoru to Always Copy. Setting these properties to None and Do not copy made the problem go away while the program still successfully reads and writes from the condfiguration settings. Weird, but OK, it works!

人吐槽 人点赞



用户名: 密码:
验证码: 匿名发表


查看评论:Weird behaviour of the app.config deployment after updating it