Reputation: 141
I get this message in the terminal:
error NU1100: Unable to resolve 'Swashbuckle.AspNetCore (>= 5.6.3)' for 'net5.0'
I tried to run dotnet restore as it reccomended but it will not restore
Upvotes: 14
Views: 7440
Reputation: 1
TRY THESE STEPS
Step1 open Nuget Manager console
Step2 PM> get-help NuGet
Step3 PM> Update-Package it will restore all file of Nuget Manager
RESON BEHIND
Swashbuckle.AspNetCore" Version="5.6.3"
THIS package is not load properly
Upvotes: 0
Reputation: 521
Just got the same issue on a clean machine. I managed to fix it running the command:
dotnet nuget add source --name nuget.org https://api.nuget.org/v3/index.json
After that, create/restore your project and it should work.
Upvotes: 52
Reputation: 56
I was trying to build an API using dotnet CLI as well, for a couple of days now. Ended up getting no answer from microsoft, or another source of info.
Anyways, the only way I made it work was unstalling .NET SDK 5.0.203 (Latest version for the time being), and installing .NET SDK 5.0.101, and thats it, new api command works flawlessly.
Upvotes: 2
Reputation: 1
The problem may be with the missing of the nuget packages. I had the same problem.
Try these steps:
Upvotes: 0
Reputation: 235
Could you make sure your .csproj
file looks a little bit like this?
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
</ItemGroup>
</Project>
Upvotes: 0