how do i generate WCF connected services on build/restore?
Ancient tech, I know. Unfortunately I have to live with it.
The project currently looks like this:
The
Reference.cs
files are generated either via RightClick -> update
each service in the solution explorer, or by running dotnet-svcutil --update 'Connected Services\MyService1\ConnectedService.json'
(assuming you have that tool installed).
I'd like to configure my project so that these files get automatically generated on build or restore, but avoid re-generating them if they already exist. How do I do this?2 Replies
I spent many hours reading through MSDN trying to wrap my head around MSBuild, but the best I was able to put together is this:
very copypasty, very slow (compared to doing it manually using the UI), CodeGen1-3 run sequentially (even more slow), and it doesn't use the provider configured in the
ConnectedService.json
file. There gotta be a better way to do this. how?It's been a long time since I messed with WCF -- but there used to be a means to have the connections autogenerated but I don't remember how it was done.
This is my autogenerated service connector: https://github.com/felsokning/Tomte/blob/master/Fels%C3%B6kning.Tomte/Fels%C3%B6kning.Tomte.PowerShell/WorkflowService.cs
So, I know that it can be done - but I'm genuinely sorry that I can't remember how it was done. ☹️