Refreshing service references updates the 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?
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.
Ended up doing this programmatically which solved the problem.
精彩评论