在app.config部署更新后怪异的行为 [英] Weird behaviour of the app.config deployment after updating it

查看:230
本文介绍了在app.config部署更新后怪异的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搬一些硬codeD设置自定义栏目(所以我没有使用< appSetting >标签)在我的ClickOnce的的app.config应用。当更新,客户端得到一个错误,指出该服务器给了一个404未找​​到错误的文件myapp.exe.config.deploy。浏览服务器我没有找到改变的app.config那里,只有它被命名为app.config.deploy。

思考是聪明的我改名的app.config到myapp.exe.config在开发计算机上,再出版。没有工作......命名该文件回的app.config和发布错误消失了,客户使用的设置后,愉快然而!

请解释一下出了什么问题?

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?

推荐答案

在我所设定的构建行动内容,并复制到outputdirectoru为始终复制的app.config的属性。设置这些属性无,不要复制使问题消失,而程序仍成功地读取并condfiguration设置写道。奇怪,但行,它的作品!

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!

这篇关于在app.config部署更新后怪异的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆