question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nswag stuck, noBuild: true

See original GitHub issue

Oddly 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:open
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
RicoSutercommented, Jun 1, 2021

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?

0reactions
jarrettvcommented, Sep 7, 2021

Also having this issue with MSBuild and NetCore31 using aspNetCoreToOpenApi with csproj. Always hangs after it announces Duration: 00:00:03.0259005

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found