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 ?
I was trying to solve the same problem. Here's what ended up doing. In the .csproj, under AfterBuild target, add a task to fetch the SDK path, and use the Exec command to run the svcutil.exe. I had to use " because the path contains spaces.
<Target Name="AfterBuild">
<GetFrameworkSdkPath>
<Output TaskParameter="Path" PropertyName="SdkPath"/>
</GetFrameworkSdkPath>
<Exec Command=""$(SdkPath)bin\NETFX 4.5.1 Tools\svcutil.exe" $(TargetPath)"/>
</Target>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With