WCF: 'Update Service Reference' hoses my files
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.co开发者_开发百科nfig
)?
Thanks
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!
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.
精彩评论