Question re dotnet-svcutil and bootstrapper
I'm trying to run dotnet-svcutil in the debugger and have an issue with the bootstrapper and package restore.
If I build the tool and run it from the command line, e.g.
dotnet-svcutil "http://localhost/WCFTest/Service1.svc?wsdl -d D:\WCFTest -r "C:\Users\passp\source\repos\WCF_Test\SharedDataContracts\bin\Debug\netstandard2.0\SharedDataContracts.dll" -v debug"
This works fine. I get a bootstrapper created at say "...\AppData\Local\Temp\dotnet-svcutil-lib_Temp\2020_Jul_15_14_44_27\SvcutilBootstrapper\bin\Debug\netcoreapp3.1" and this is fully populated with dependent assemblies like NewtonSoft.Json.dll (9.0.0.1).
If I run the same in the VS debugger the console output looks identical, up to 'Invoking bootstrapper...'. But none of the packages get restored in this case so the tool fails with " System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0...".
Any ideas?
I was hoping to see if there was anything I could do about https://github.com/dotnet/wcf/issues/3812.
Also running in to the same thing more than a year later. Can´t find how to solve it.
Try to create new folder, cd to new folder and run dotnet-svcutil again
I ended up solving this by running dotnet-svcutil in a separate folder and simply copying the generated contents over to my .NET Core project. it seems like this wasn't the intended purpose but it works fine in my case.
Thanks for sharing the workaround!
I see the original issue occurred when trying to debug dotnet-svcutil with bootstrapper, personally I would run "dotnet svcutil [url/wsdl-path]", during the execution time go to %temp%\dotnet-svcutil-lib_Temp folder, find the corresponding timestamped folder generated, copy out the svcutilbootstrapper project before it being cleaned up. Then open svcutilbootstrapper project from VS, set debug parameter with the json file find in the same folder of svcutilbootstrapper project, configure working directory as where one would normally run the tool from (for example the root directory of a newly created console app), start debugging, with matched dotnet-svcutil-lib symbol loaded, VS debugger should be able to hit the breakpoint set in source code.