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.

Swashbuckle.AspNetCore.Cli only targets .NET Core 2.1

See original GitHub issue

Package: Swashbuckle.AspNetCore.Cli Version: 5.0.0-rc3 Project Target Framework: netcoreapp3.0

Reproduction Steps:

  1. Create .NET Core 3.0 API project
  2. Configure Swashbuckle.AspNetCore-5.0.0-rc3
  3. Run dotnet tool run swagger tofile --output output/swagger.json bin/Release/netcoreapp3.0/MyWebApi.dll v1

Description: I have a .NET Core 3.0 project that includes Swashbuckle.AspNetCore-5.0.0-rc3 that I am trying to use the CLI to build a swagger file for during the build process. I have tool included in my dotnet tools manifest and when I restore, it installs correctly. However when I run the command, I get the following. Since Swashbuckle.AspNetCore-5.0.0-rc3 supports netcoreapp3.0, I suspect the CLI should as well.

Tool 'swashbuckle.aspnetcore.cli' (version '5.0.0-rc3') was restored. Available commands: swagger

Restore was successful.
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.0' was not found.
  - The following frameworks were found:
      3.0.0-rc1-19456-20 at [/opt/hostedtoolcache/dotnet/shared/Microsoft.NETCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

4reactions
ericl85commented, Sep 30, 2019

Just discovered you can use the environment variable:

DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2 to work around this.

https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/multilevel-sharedfx-lookup.md

Looks like they there is a RollForward property for the csproj file. I tried adding it to my own project file, but it did not work, so I’m thinking it needs to go on the Swashbuckle CLI project file.

3reactions
aelijcommented, May 11, 2020

Have you tried this on a machine that doesn’t have .NET Core 2.x installed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

.net core - How to force Swashbuckle.Aspnetcore.Cli to use ...
I'm upgrading a project to use .Net Core 3.1 from 2.2, and am struggling with getting my tools working. I have this section...
Read more >
Get started with Swashbuckle and ASP.NET Core
Learn how to add Swashbuckle to your ASP.NET Core web API project to integrate the Swagger UI.
Read more >
Swashbuckle.AspNetCore
Swagger tooling for APIs built with ASP.NET Core. Generate beautiful API documentation, including a UI to explore and test operations, directly from your ......
Read more >
Swashbuckle.AspNetCore.Cli 6.5.0
Version Downloads Last updated 6.5.0 739,076 7 months ago 6.4.0 1,292,126 7/19/2022 6.3.1 379,722 4/22/2022
Read more >
Upgrading from .NET Core 2.1 to .NET 6.0
I upgraded an old project from .NET Core 2.1 to .NET 6. ... Essentially, this value is just used for CLI tools, but...
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