开发者

Weird behaviour of the app.config deployment after updating it

开发者 https://www.devze.com 2022-12-24 15:54 出处:网络
I moved some hardcoded settings to acustom 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 se

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 ex开发者_开发百科plain 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!

0

精彩评论

暂无评论...
验证码 换一张
取 消