tags:

views:

26

answers:

1

When I add a Service Reference to my project in Visual Studio, it autogenerates a proxy to the service called ServiceNameClient. I really don't like that naming scheme. Is there a way to change it to something like ServiceNameProxy?

I can rename the class myself in the autogenerated code, but any time I add new features to the service, and go to UpdateServiceReference, it re-generates the code and changes it back to the old name.

My brief web search uncovered a way to create my own WCF Proxy Generator class, but I'm hoping there is some simple attribute that changes how the class name is calculated.

+2  A: 

Like you, I have been dissatisfied with Visual Studio's code generation of the WCF service reference. I never have liked the naming scheme, and I also don't want to change it every time I update my service.

To answer your question, I don't know if there's a way to change it or not. But I had an epiphany after watching this video at dnrTV. Since then, I've been manually coding my WCF client proxies using a naming scheme that fits my project.

Matt Davis
Great Video. Looks like I'm going to start coding my own as well
vishvananda