Hossein Dara
Hossein Dara

Reputation: 39

Can't install "Microsoft.EntityFrameworkCore.Tools.Dotnet" in ASP.NET Core

I have a Class Library named DataLayer and wanted to install some nuget packages to it.

I have successfully installed the packages below:

When I try to install the following package, however:

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

Answers (2)

Obaid Ur Rehman
Obaid Ur Rehman

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

Pritom Sarkar
Pritom Sarkar

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

Related Questions