Reputation: 1
I am using a solution referencing several services. It's time consuming to update all services one by one and can lead to oversights. I am asked if I can find a way to automatically update all references through svcutil at build time.
What I got to work was to generate a class using the endpoint of the service but it does not update the reference in the project nor generate all other files like *.xsd
I tried several syntaxes, got it to work in the .csproj like this
<Target Name="AfterBuild">
<Message Text="Updating Web Reference..."/>
<Exec Command=""{pathToSvcutil}\svcutil.exe" "{urlToServiceEndpoint}" /out:"{SomeLocalPath}\Test.cs" /n:"*,{MyNamespace}""/>
</Target>
I'm not really sure though if the /n is very useful in my case or if I need the /out parameter (used it because otherwise the build was successful but nothing seemed to change)
Bonus point : I was planning to use the command for every service I have to update, but is there any more elegant way ?
Thanks a lot
Edit : I don't know if I was accurate enough, so what I truly want is to have the exact same behavior as when I click on services references and press "Update"
Upvotes: 0
Views: 1005