asp.net-coreswaggerswashbuckle.aspnetcore

You must install or update .NET to run this application


I have a WebAPI project and I do a post-build process that calls "swagger.exe", which is a tool provided by NuGet Package. To install globally it, I used the following command:

dotnet tool install -g --version 5.3.1 Swashbuckle.AspNetCore.Cli

The problem is: My CI process was working fine yesterday. Today it doesn't work anymore. I narrowed down the problem to the swagger executable... Just by calling it, without any parameters, it returns the following message:

Terminal screenshot

You must install or update .NET to run this application.

App: C:\Users\DRibeiro\.dotnet\tools\swagger.exe
Architecture: x64
Framework: 'Microsoft.NETCore.App', version '3.1.27' (x64)
.NET location: C:\Program Files\dotnet\

The following frameworks were found:
  3.1.21 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  3.1.26 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  5.0.12 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  5.0.17 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  6.0.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  6.0.7 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

Notice that I have the Runtime 3.1.26 installed on my Windows.

Notice, also, that the Swashbuckle.AspNetCore.Cli version 5.3.1 was released in 2020! More than 2 years ago! NuGet Screenshot

So, the question is: Why this Package from 2020 requires a .NET Runtime released 2 weeks ago? Why can't it use one of the other Runtimes that I already have (and was working fine yesterday) ?

I know that I could just install the newer version and the problem would be solved... Just want to keep my CI's running smoothly without having to fix it every time a new Runtime version is released.


Solution

  • It turns out that our Automatic Software Distribution system was not doing it's job correctly and sent to our CI machines the incorrect files for the .NET Runtimes. Probably some human error of the network admin.

    I disconnected this particular CI machine from the system and reinstalled the Runtime, and everything worked fine.