Refreshing service references updates the app.config
Asked Answered
I

2

3

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?

Idiom answered 7/1, 2011 at 13:8 Comment(0)
I
0

Ended up doing this programmatically which solved the problem.

Idiom answered 2/5, 2012 at 15:41 Comment(1)
Can you please give a brief description of how you got around this issue? Using ChannelFactory<T>? Thanks.Demurrage
R
0

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.

Remissible answered 7/1, 2011 at 13:20 Comment(2)
thanks for the answer, but I don't have that applicationSettings section within my app.config. (might be a VB.NET thing?). I do have an endpoint section that refers to the service thoughIdiom
It was just an example to go with what I was saying about the app.config references the WS.Remissible
I
0

Ended up doing this programmatically which solved the problem.

Idiom answered 2/5, 2012 at 15:41 Comment(1)
Can you please give a brief description of how you got around this issue? Using ChannelFactory<T>? Thanks.Demurrage

© 2022 - 2024 — McMap. All rights reserved.