5.6
using Visual Studio 15.9.6
Launch the PackageManager console
PM> Install-Package Swashbuckle.Core
Swashbuckle installs successfully
Fails to install
PackageManager Console output:
Restoring packages for C:\Users\source\repos\Service\Service\Service.API.csproj...
NU1701: Package 'Microsoft.AspNet.WebApi.Core 4.0.20710' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.2'. This package may not be fully compatible with your project.
NU1701: Package 'Swashbuckle.Core 5.6.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.2'. This package may not be fully compatible with your project.
Install-Package : NU1107: Version conflict detected for Microsoft.AspNet.WebApi.Client. Install/reference Microsoft.AspNet.WebApi.Client
5.2.6 directly to project CustomerService.API to resolve this issue.
CustomerService.API -> Microsoft.AspNetCore.App 2.2.0 -> Microsoft.AspNet.WebApi.Client (>= 5.2.6 && < 5.3.0)
CustomerService.API -> Swashbuckle.Core 5.6.0 -> Microsoft.AspNet.WebApi.Core 4.0.20710 -> Microsoft.AspNet.WebApi.Client (>= 4.0.20710 &&
< 4.1.0).
At line:1 char:1
Install-Package : Package restore failed. Rolling back package changes for 'CustomerService.API'.
At line:1 char:1
Time Elapsed: 00:00:03.7235909
Getting the same error op, +1
What fixed this for me was to use Swashbuckle.AspNetCore (4.0.1) instead of Swashbuckle (5.6.0)
Try this:
PM> Install-Package Swashbuckle.AspNetCore --version 4.0.1
Of course it does, it pulls all dependencies along with it. And since you want to install Swashbuckle.AspNetCore it will pull .NET Core dependencies.
I've used Swashbuckle for Web API projects before and it works like a charm. But now I'm trying to use the Swashbuckle.AspNetCore on my .Net Core 2.1 MVC project (this is not a WebAPI project), and it installs with no errors, but it doesn't work. I don't see it creating a SwaggerConfig.cs file. So, my question is, will this work for a none WebApi project? i.e. just an MVC project?
Most helpful comment
What fixed this for me was to use Swashbuckle.AspNetCore (4.0.1) instead of Swashbuckle (5.6.0)