Reputation: 39
I have a Class Library named DataLayer
and wanted to install some nuget packages to it.
I have successfully installed the packages below:
Microsoft.EntityFrameworkCore
(version 5.0.8)Microsoft.EntityFrameworkCore.SqlServer
(version 5.0.8)When I try to install the following package, however:
Microsoft.EntityFrameworkCore.Tools.Dotnet
(version 2.0.3)I get this error :
Severity Code Description Project File Line Suppression State Error Package 'Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.3' has a package type 'DotnetCliTool' that is not supported by project 'DataLayer'.
I've restarted Visual Studio several times and also deleted my Class Library one time, but the error keeps occurring. Can anyone help me?
Upvotes: 1
Views: 1756
Reputation: 1
You can use Microsoft.EntityFrameworkCore.Tools Package instead of Microsoft.EntityFrameworkCore.Tools.DotNet. When I was new to ef core this was suggested by a Tutorial but later I realized Microsoft.EntityFrameworkCore.Tools works same. Seems like the Microsoft.EntityFrameworkCore.Tools.DotNet is an older version and not working for my project version.
Upvotes: 0
Reputation: 2252
Microsoft.EntityFrameworkCore.Tools.DotNet
needs to be added to your class library by editing the project.
Right-click the project and select Edit *.csproj
Then, add the following:
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0-preview2-final" />
</ItemGroup>
Upvotes: 1