So I have this NSWAG file that works since forever, suddenly today without changing anything it throws this error:
call npm install -g nswag
changed 1 package in 4s
NSwag NPM CLI
NSwag command line tool for .NET Core Net60, toolchain v14.0.0.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))
Visit http://NSwag.org for more information.
NSwag bin directory: C:\Users\[...]\nswag\bin\binaries\Net60
NConsole.UnusedArgumentException: Unrecognised arguments are present: [/runtime:Net60]
at NConsole.CommandLineProcessor.ProcessSingleAsync(String[] args, Object input)
at NConsole.CommandLineProcessor.ProcessAsync(String[] args, Object input)
at NSwag.Commands.NSwagCommandProcessor.ProcessAsync(String[] args) in /_/src/NSwag.Commands/NSwagCommandProcessor.cs:line 61node:child_process:960
throw err;
^
Error: Command failed: dotnet "C:\Users\[...]\nswag\bin/binaries/Net60/dotnet-nswag.dll"
I run the following command, and the error makes me think it is not able to understand the /runtime parameter, which is actually fine as per documentation, and again... it worked in the past.
call npm install -g nswag
call nswag run generate.Service.nswag /runtime:Net60
Some things I tried, to execute same command but forcing to install a previous version of nswag (because I see new version applied quite recently) but this didn't work either. I tried with all the versions from like last year:
Another solution I tried is to remove this "wrong parameter", and I get this error now:
System.InvalidOperationException: The specified runtime in the document (NetCore21) differs from the current process runtime (Net70). Change the runtime with the '/runtime:NetCore21' parameter or run the file with the correct command line binary.
So i'm not sure what else I could try, I tried even the preview version which is not released yet and that also has the same issue. I see this problem comes and goes in the last 4 years, so probably somebody has a solution.
Thanks.