Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I prevent VS2010 to create a new binding each time I update a service reference?

I'm developing a Winforms Client application with a WCF Service in C # 3.5 and Visual Studio 2010.

Every time I use "Update Service Reference" in the IDE, considering I have already a working binding in app.config, an additional binding entry is generated with the same name and a trailing "1".

My app.config on the client side is :

<bindings>
  <wsHttpBinding>
     <binding name="WSHttpBinding_IIssueTracker" closeTimeout="00:01:00"...

After a "Update Service Reference", I have :

<bindings>
  <wsHttpBinding>
     <binding name="WSHttpBinding_IIssueTracker" closeTimeout="00:01:00"...
     <binding name="WSHttpBinding_IIssueTracker1" closeTimeout="00:01:00"...

So I need to remove this unused binding all the time.

This is driving me nut. Is there a way to disable this behaviour ?

like image 462
Larry Avatar asked Jul 01 '11 11:07

Larry


People also ask

How to update the service reference?

To update a service reference In Solution Explorer, right-click the service reference and then click Update Service Reference. A progress dialog box displays while the reference is updated from its original location, and the service client is regenerated to reflect any changes in the metadata.

How to Add service reference in mvc?

Open your project or create a new one. In the Solution Explorer right-click on YourSolution/YourProject/References. Select "Add Service Reference..." from the context menu. In the Add Service Reference dialog, enter the service metadata endpoint URL in Address line and press Go button.

How to Add Connected service in. net Core?

(For a . NET Core or . NET Standard project, this option is available when you right-click on the Dependencies node of the project in Solution Explorer and choose Manage Connected Services.) On the Connected Services page, select Add Service Reference.

How to Add WCF service in. net Core?

To use WCF services in . NET Core, you need to create a proxy client of the required service. Proxy is actually a contract equivalent of actual service and contains complete details of the Interface and method exposed by WCF service. One can also use the Channel factory technique to connect to the WCF service easily.


1 Answers

The way we solved this was to move the Service Reference to a separate library, and delete the (newly generated) app.config from the library project after executing Update Service Reference.

like image 189
devio Avatar answered Oct 18 '22 09:10

devio