NSwag
NSwag copied to clipboard
command: dotnet node_modules/nswag/bin/binaries/NetCore21/dotnet-nswag.dll" run nswag.file.json
I am getting this below error while running the npm run generate command. Can any one help me how to resolve this issue ?
I have tried setting the runtime to NetCore21, but that does not help much.
Failed to initialize CoreCLR, HRESULT: 0x80004005
node:child_process:902
throw err;
^
Error: Command failed: dotnet node_modules/nswag/bin/binaries/NetCore21/dotnet-nswag.dll" run nswag.filejson
at checkExecSyncError (node:child_process:828:11)
at Object.execSync (node:child_process:899:15)
at node_modules/nswag/bin/nswag.js:69:11
at ChildProcess.exithandler (node:child_process:390:7)
at ChildProcess.emit (node:events:527:28)
at maybeClose (node:internal/child_process:1090:16)
at Socket.
@ManiPandiri - same. Did you get this to work? This happened some time last year but was due to an automatic switch to .NET 6. Previously the solution was to ensure that .NET 3.1 was being used, but now that solution doesn't work either. I'm curious as to why nswag
is going to NetCore21
... if this means 2.1, 2.1 has long been end of life, and shouldn't be used at all....
@ManiPandiri - turns out my nswag
was too old, I installed the latest (13.16.1 at the time of this post) with:
npm install nswag@latest
also note I had "runtime": "Default"
in my nswag .json
config file
Now it's working again!