刷新服务引用会更新app.config
每次我对 WS 进行更改并更新 Visual Studio 中的引用时,VS 都会使用其他不必要的信息覆盖我的 app.config。因此,当我之后启动客户端时,我收到此错误:
处理标头时发现错误
代码生成器所做的更改是从每个绑定中删除这一行(注意我正在使用 customBinding/httpsTransport):
<security authenticationMode="UserNameOverTransport" includeTimestamp="false">
<secureConversationBootstrap/>
</security>
然后我必须关闭客户端,恢复app.config更改并重新启动客户端这很麻烦。
我更希望 app.config 单独保留。
您是否遇到同样的问题并且有解决方法吗?
Every time I make changes to my WS and update the reference in Visual Studio, VS overwrites my app.config with additional unnecessary information. So when I start my client afterwards, I get this error:
An error was discovered processing the header
The changes that the code generator made was to remove this line from every binding (note I'm using customBinding/httpsTransport):
<security authenticationMode="UserNameOverTransport" includeTimestamp="false">
<secureConversationBootstrap/>
</security>
Then I have to close the client, revert the app.config changes and restart the client which is a hassle.
I would prefer if the app.config would be left alone.
Are you experiencing the same problem and do you have a workaround?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
别再改变你的WS了!?! :P
说真的,因为您正在更新 WS,然后更新引用,所以它将更新 app.config / web.config。原因是 applicationSettings 下有一个部分引用了 WS。
EX:
遗憾的是,我认为没有办法阻止 VS 更新 app.config。但我可能是错的。
Stop changing your WS!?! :P
Seriously though, since you are updating your WS and then updating the reference it is going to update the app.config / web.config. The reason is because there is a section under applicationSettings that reference the WS.
EX:
Sadly, I do not think there is a way to stop VS from updating the app.config. I could be wrong though.
最终以编程方式完成此操作,解决了问题。
Ended up doing this programmatically which solved the problem.