-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nswag 14 CLI /runtime argument not running with Net80 #4678
Comments
As mentioned in log, cmd is using |
@krzyhan Yes that looks to be the issue. Well found, I was hunting but came up with nothing. Let's hope this can get published soonest. |
I'm still getting this issue with 14.0.1 when calling
|
@ptasev I have the same error. After i removed |
Same here but had to remove the Seems like the runtime argument in the cli is not used anymore? NConsole.UnusedArgumentException: Unrecognised arguments are present: [/runtime:Net60] |
I'm really confused if we really are no longer supposed to be using this, or if it's a bug. I see there's runtime here but it's defaulted to Net60:
Also, nswag npm.js seems to accept the runtime argument, considering that it converts legacy args to using runtime, so I'm not sure what to think: NSwag/src/NSwag.Npm/bin/nswag.js Line 17 in 313ea53
|
any idea about this error please! |
remove
for |
do you have seems like project has not been built yet |
Still an issue in 14.0.8. Running from the command line without /runtime:Net80 tells you to add it. Running with it tells you to remove it.
Renaming the file to file.nswag and then running this does work: |
Removing passed runtime argument in nswag.cmd works for me. @ECHO OFF
set args=%*
IF NOT "%args:/runtime:winx86=%" == "%args%" (
"%~dp0/Win/nswag.x86.exe" %*
GOTO end
)
IF NOT "%args:/runtime:net60=%" == "%args%" (
dotnet "%~dp0/Net60/dotnet-nswag.dll" %*
GOTO end
)
IF NOT "%args:/runtime:net70=%" == "%args%" (
- dotnet "%~dp0/Net70/dotnet-nswag.dll" %*
+ dotnet "%~dp0/Net70/dotnet-nswag.dll" %args:/runtime:net70=%
GOTO end
)
IF NOT "%args:/runtime:net80=%" == "%args%" (
dotnet "%~dp0/Net80/dotnet-nswag.dll" %*
GOTO end
)
"%~dp0/Win/nswag.exe" %*
:end |
Still an issue in 14.1 With /runtime:Net60 Without /runtime:Net60 |
I presume your nswag json file specifies the runtime as .NET 6 despite the assembly being .NET 8. You'll have to change the settings. |
Seeing the same here : "runtime": "Net80" specified in the nswag file |
I agree with Tridus. Omitting the file name works. Definitely seems like a bug. |
Runtime specified in nswag.json as "Net80".
Not quite sure if it's needed in both places, but did it to make sure.
Then run the Nswag CLI tool (npm i -g nswag@14) run command:
Alright then let's set the /runtime parameter with the CLI:
The correct runtime is specified in the config file.
It seems like there is an issue with the CLI. Please advise how to get this working as after updating to net80 we cannot use nswag via the CLI to generate Typescript.
The text was updated successfully, but these errors were encountered: