I’m writing a WCF service which is going to be used extensively within our company, and I’d like to generate WCF client proxies as part of the build process and package them within an assembly so that clients of the service don’t have to repeat this process on their end numerous times. Is there any way that anybody knows of to accomplish this ? Are there any pre-existing build tasks for MSBuild ?
Share
Here’s what I wound up doing:
1) Create the project that has the service for which I want to generate client code
2) Create an MSBuild task that does the following:
3) Insert the MSBuild task into the ‘AfterBuild’ target of the project containing the service.
Now every time I build the service, I get an automatically generated assembly that contains the client code that multiple other projects in our company can reference, without having to re/generate the same Web Reference in multiple projects. They can just reference a single assembly, and update more easily, having only to update one line in a project file rather than multiple files generated by the web reference generator. If anybody’s interested, I can send them the code for the MSBuild task and the XML snippet for using it.