views:

33

answers:

2

Every time that I make a change to the contract of my WCF service, I need to have Visual Studio update the service references in all of my client projects.

This process regenerates my client's app.config file and, since I have hand-tuned the "bindings" section of the file, I need to back-up my file and then restore it each time I have VS do the update.

Is there a way to avoid this necessity (eg: have VS update the service reference without rewriting anything in app.config)?

Thanks

A: 

Use SvcUtil.exe along with the /noconfig parameter to generate a clean proxy file!

You can setup SvcUtil in Visual Studio from the Tools > External Tools menu for convenience.

The generated proxy is basically the same as the code generated with Update Service Reference.

Good luck!

Maxime
+1  A: 

Every time that I make a change to the contract of my WCF service, I need to have Visual Studio update the service references in all of my client projects.

Why? I do not.

Here is the deal: I do not use generated proxies. I use WCF, shared types (i.e. a separate DLL that I compile has all transfer classes, and is used by both sides) and as a result this DLL pproject is

  • either referenced as project from all work in the solution (in case WCF is used within an application
  • publiushed and referenced by clients.

But no "oh god, things went wrong". I also rarely have configuration in app.config and code the setup - mostly a lot better for the stuff I do, but mileage here may vary.

TomTom
I'm also using a shared type library to define the classes of objects that get passed in and out of the service. However, it happens with some frequency that I need to add a new method to the service itself, which is still under heavy development.
mcoolbeth