nswag stuck, noBuild: true
See original GitHub issueOddly starting a week ago or so - intermittently, nswag will fail with:
Executing file 'nswag.nswag' with variables 'Configuration=Debug'...
Launcher directory: C:\Windows\ServiceProfiles\NetworkService\.nuget\packages\nswag.msbuild\13.2.2\tools\NetCore31
System.InvalidOperationException: Process dotnet timed out.
at NSwag.Commands.Generation.AspNetCore.Exe.RunAsync(String executable, IReadOnlyList`1 args, IConsoleHost console, Nullable`1 timeout) in C:\projects\nswag\src\NSwag.Commands\Commands\Generation\AspNetCore\Exe.cs:line 70
at NSwag.Commands.Generation.AspNetCore.AspNetCoreToSwaggerCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in C:\projects\nswag\src\NSwag.Commands\Commands\Generation\AspNetCore\AspNetCoreToOpenApiCommand.cs:line 215
at NSwag.Commands.NSwagDocumentBase.GenerateSwaggerDocumentAsync() in C:\projects\nswag\src\NSwag.Commands\NSwagDocumentBase.cs:line 279
at NSwag.Commands.NSwagDocument.ExecuteAsync() in C:\projects\nswag\src\NSwag.Commands\NSwagDocument.cs:line 81
at NSwag.Commands.Document.ExecuteDocumentCommand.ExecuteDocumentAsync(IConsoleHost host, String filePath) in C:\projects\nswag\src\NSwag.Commands\Commands\Document\ExecuteDocumentCommand.cs:line 86
at NSwag.Commands.Document.ExecuteDocumentCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in C:\projects\nswag\src\NSwag.Commands\Commands\Document\ExecuteDocumentCommand.cs:line 32
at NConsole.CommandLineProcessor.ProcessSingleAsync(String[] args, Object input)
at NConsole.CommandLineProcessor.ProcessAsync(String[] args, Object input)
at NConsole.CommandLineProcessor.Process(String[] args, Object input)
at NSwag.Commands.NSwagCommandProcessor.Process(String[] args) in C:\projects\nswag\src\NSwag.Commands\NSwagCommandProcessor.cs:line 56
csproj file:
<Target Name="NSwag" AfterTargets="Build">
<Exec Command="$(NSwagExe_Core31) run nswag.nswag /variables:Configuration=$(Configuration)" />
</Target>
nswag file snippet:
"runtime": "NetCore31",
"defaultVariables": "",
"documentGenerator": {
"aspNetCoreToOpenApi": {
"project": "MyProject.csproj",
"msBuildProjectExtensionsPath": null,
"configuration": "$(Configuration)",
"runtime": null,
"targetFramework": "netcoreapp3.1",
"noBuild": true,
...
At first, I double checked the value of noBuild
& confirmed this was set to true, since I know this can cause an infinite loop. It indeed is and always has been set to true. It just sometimes works and sometimes times out & fails now. We’ve been using this successfully for months, but seemingly started recently.
Any idea what could be causing this?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
asp.net mvc - Nswag Generate OpenApi Spec
I have a number of controllers marked with different versioning, and marked with corresponding documentName . This works fine, I can then ...
Read more >Looking for an alternative to NSwag : r/dotnet
That looks really interesting, first I've heard of it. Might try to use it next week on a small project to see how...
Read more >Automatically generating Typescript API clients on build with ...
The NSwag target is configured to log the output of nswag.exe as MSBuild messages. If the exit code is anything but 0 and...
Read more >Waypoints - Expanded Bot Patrols and Navmesh
Expand where bots can explore with new patrols and full map navmesh coverage! Expand the area that bots can roam, and increase the...
Read more >[Support Guide] How long should Netlify builds take?
This is a real problem. One common question i'm seeing in netlify/community - Gitter is about System resources: How many RAM and CPU...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hmm, I think i saw something similar in the past where the ASP.NET Core API Explorer goes into an infinite loop or something (ie not in the NSwag code but when NSwag tries to query the APIs)… maybe this is fixed in .NET 5?
Also having this issue with MSBuild and NetCore31 using
aspNetCoreToOpenApi
with csproj. Always hangs after it announcesDuration: 00:00:03.0259005