xiaobo
xiaobo

Reputation: 651

Package 'Microsoft.EntityFrameworkCore.Tools.DotNet 1.0.0-msbuild2-final' has a package type 'DotnetCliTool' that is not supported by project

When I use Visual Studio 2017 RC to create netcore project and Nuget Microsoft.EntityFrameworkCore.Tools.DotNet, but I get an error.

Package 'Microsoft.EntityFrameworkCore.Tools.DotNet 1.0.0-msbuild2-final' has a package type 'DotnetCliTool' that is not supported by project 'src\WebApplication1'.

How do I resolve it?

Upvotes: 15

Views: 12150

Answers (2)

suyelen
suyelen

Reputation: 41

Edit your project file and add these

<ItemGroup>
    <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet">
        <Version>1.0.0-msbuild3-final</Version>
    </DotNetCliToolReference>
</ItemGroup>

And than open visual studio's developer PowerShell editor and run these command

dotnet add package Microsoft.EntityFrameworkCore.Tools.DotNet 

Upvotes: 0

xiaobo
xiaobo

Reputation: 651

Open your .csproj file and add the lines:

<PackageReference Include="Microsoft.EntityFrameworkCore.Tools"
    Version="1.0.0-msbuild2-final" />
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet"
    Version="1.0.0-msbuild2-final" />

Upvotes: 20

Related Questions