刷新服务引用会更新app.config

发布于 2024-10-11 11:23:13 字数 504 浏览 4 评论 0原文

每次我对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

七七 2024-10-18 11:23:13

别再改变你的WS了!?! :P

说真的,因为您正在更新 WS,然后更新引用,所以它将更新 app.config / web.config。原因是 applicationSettings 下有一个部分引用了 WS。

EX:

 <applicationSettings>
    <RemoteAssessment.CatCall.My.MySettings>
        <setting name="RemoteAssessment_CatCall_CATService01_CATService"
            serializeAs="String">
            <value>URLTOSERVICE/catservice.asmx</value>
        </setting>
    </RemoteAssessment.CatCall.My.MySettings>
</applicationSettings>

遗憾的是,我认为没有办法阻止 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:

 <applicationSettings>
    <RemoteAssessment.CatCall.My.MySettings>
        <setting name="RemoteAssessment_CatCall_CATService01_CATService"
            serializeAs="String">
            <value>URLTOSERVICE/catservice.asmx</value>
        </setting>
    </RemoteAssessment.CatCall.My.MySettings>
</applicationSettings>

Sadly, I do not think there is a way to stop VS from updating the app.config. I could be wrong though.

旧夏天 2024-10-18 11:23:13

最终以编程方式完成此操作,解决了问题。

Ended up doing this programmatically which solved the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文