Dotnet ef does not work with vs2017 / netcore1.1

I recently updated a project to use efcore 1.1 as well as visual studio 2017 rc. Also use win10.

The dotnet ef commands previously worked without problems, but now they just throw the following errors.

{path}.csproj : error MSB4057: The target "_EFGetProjectMetadata" does not exist in the project.

Couldn't read metadata for project '{path}.csproj'. Ensure the package 'Microsoft.EntityFrameworkCore.Tools' is installed.

I checked that the tools are installed, dotnet restore running, everything builds / works fine. This is only the ef tool causing the problems.

Inside the .csproj file, the following appears.

<PackageReference Include="Microsoft.EntityFrameworkCore.Tools"> <Version>1.1.0-preview4-final</Version> </PackageReference>

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

+5
source share
2 answers

We are currently tracking this issue at https://github.com/aspnet/EntityFramework/issues/7072 . We will keep this thread updated when we diagnose the problem, find workarounds, etc.

+2
source

Use version 1.0.0-msbuild1-final for Microsoft.EntityFrameworkCore.Tools .

 <PackageReference Include="Microsoft.EntityFrameworkCore.Tools"> <Version>1.0.0-msbuild1-final</Version> </PackageReference> 

This worked for me what I used to use the dotnet 1.0.0-preview3-004056 CLI tools.

+4
source

Source: https://habr.com/ru/post/1259932/


All Articles