You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since upgrading my test project (previously working for .Net 7 and .Net 8) to .Net 9 I'm now getting the following error when generating my C# client via post-build step:
<Target Name="NSwag" AfterTargets="Build">
<Exec Command="$(NSwagExe_Net90) run nswag.json /variables:Configuration=$(Configuration)" />
</Target>
CNR.Example.API net9.0 failed with 1 error(s) (7.6s) → CNR.Example.API\bin\Debug\net9.0\CNR.Example.API.dll
NSwag command line tool for .NET Core Net90, toolchain v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))
Visit http://NSwag.org for more information.
NSwag bin directory: C:\Users\Christopher.Cameron\.nuget\packages\nswag.msbuild\14.2.0\tools\Net90
Executing file 'nswag.json' with variables 'Configuration=Debug'...
System.ArgumentException: The path is empty. (Parameter 'path')
at System.IO.Path.GetFullPath(String path)
at NSwag.Commands.Generation.AspNetCore.ProjectMetadata.GetProjectMetadata(String file, String buildExtensionsDir, String framework, String configuration, String runtime, Boolean noBuild, String outputPath, IConsoleHost console) in /_/src/NSwag.Commands/Commands/Generation/AspNetCore/ProjectMetadata.cs:line 113
at NSwag.Commands.Generation.AspNetCore.AspNetCoreToOpenApiCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in /_/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs:line 70
at NSwag.Commands.NSwagDocumentBase.GenerateSwaggerDocumentAsync() in /_/src/NSwag.Commands/NSwagDocumentBase.cs:line 270
at NSwag.Commands.NSwagDocument.ExecuteAsync() in /_/src/NSwag.Commands/NSwagDocument.cs:line 67
at NSwag.Commands.Document.ExecuteDocumentCommand.ExecuteDocumentAsync(IConsoleHost host, String filePath) in /_/src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs:line 76
at NSwag.Commands.Document.ExecuteDocumentCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in /_/src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs:line 33
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 65
C:\Workspace\cnr-common-asp-2\src\CNR.Example.API\CNR.Example.API.csproj(36,5): error MSB3073: The command "dotnet "C:\Users\Christopher.Cameron\.nuget\packages\nswag.msbuild\14.2.0\buildTransitive\../tools/Net90/dotnet-nswag.dll" run nswag.json /variables:Configuration=Debug" exited with code -1.
Build failed with 1 error(s) and 8 warning(s) in 10.7s
Version of NSwag toolchain, computer and .NET runtime used
NSwag command line tool for .NET Core Net90, toolchain v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))
Describe the bug
Hello! Thank you for the excellent project!
Since upgrading my test project (previously working for .Net 7 and .Net 8) to .Net 9 I'm now getting the following error when generating my C# client via post-build step:
Version of NSwag toolchain, computer and .NET runtime used
NSwag command line tool for .NET Core Net90, toolchain v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))
To Reproduce
Here's my nswag.json configuration:
Expected behavior
C# client is successfully regenerated with minimal changes
Additional context
When we migrated from .Net 7 to .Net 8 we had to make some changes to our nswag.json configuration #4524 (comment)
The text was updated successfully, but these errors were encountered: