Swashbuckle.webapi: Can't Install Swashbuckle, Version conflict with Microsoft.AspNet.WebApi.Client

Created on 2 Feb 2019  路  5Comments  路  Source: domaindrivendev/Swashbuckle.WebApi

VERSION:

5.6

STEPS TO REPRODUCE:

using Visual Studio 15.9.6
Launch the PackageManager console
PM> Install-Package Swashbuckle.Core

EXPECTED RESULT:

Swashbuckle installs successfully

ACTUAL RESULT:

Fails to install

ADDITIONAL DETAILS

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 Swashbuckle.Core
  • ~~~~~~~~

    • CategoryInfo : NotSpecified: (:) [Install-Package], Exception

    • FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package restore failed. Rolling back package changes for 'CustomerService.API'.
At line:1 char:1

  • Install-Package Swashbuckle.Core
  • ~~~~~~~~

    • CategoryInfo : NotSpecified: (:) [Install-Package], Exception

    • FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Time Elapsed: 00:00:03.7235909

Most helpful comment

What fixed this for me was to use Swashbuckle.AspNetCore (4.0.1) instead of Swashbuckle (5.6.0)

All 5 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rautsik picture rautsik  路  4Comments

niemyjski picture niemyjski  路  3Comments

djem3000 picture djem3000  路  5Comments

benpriebe picture benpriebe  路  5Comments

josephearl picture josephearl  路  4Comments