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

北慕城南 提交于 2019-12-06 23:07:08

问题


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 ?


回答1:


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.



来源:https://stackoverflow.com/questions/6547554/how-can-i-prevent-vs2010-to-create-a-new-binding-each-time-i-update-a-service-re

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!