WCF: update service link contains duplicate configuration entries

I have a WPF application using WCF service references. When performing updates in the service, I need to update the service link, so I right-click it and click "Update Service Reference".

Execution of this result leads to duplicate entries in the App.config file of the client project.

  • It duplicates binding under wsHttpBinding - an equal record with the number postfix in the name of: WSHttpBinding_ISomeService --> WSHttpBinding_ISomeService1.
  • And it duplicates the definition of the endpoint when binding, so there is one endpoint for each wsHttpBinding. This is also a pure duplicate, with the exception of the name.

Why does it duplicate the configuration? Should I update the name? And how can I make him stop?

+3
source share
4 answers

What version of Visual Studio are you using? This is a known bug that was fixed in VS2010. Check out this link !

+3
source

code-zoop says this known bug is resolved in VS2010, but I get it in VS2010 too.

It happens when I manually change the default value for the MaxReceivedMessageSize (and others) property of the baseHttpBinding in App.config (according to this post: WCF - How to increase the size of the message. )

, , VS2010. , , , .

+2

.

, . , , ( WCF X), .

+1

(-) DLL .

web.config, Update Referene, Serviceagent, - , web.config

, , ,

MAIN DLL > ServiceAgent1 DLL > ServiceAgent2 DLL

ServiceAgent1 ServiceAgent2 ,

+1

Source: https://habr.com/ru/post/1725146/


All Articles