EF Core 2.0 Model does not get created

c# ef-migrations entity-framework entity-framework-core sql-server

Question

I am running Scaffold-DbContext "Server=XXX;Database=XXX;User id=XXX;password=XXX" Microsoft.EntityFrameworkCore.SqlServer -OutputDir XXX and no model is getting created. I have previously ran this script on this computer, project, and database and the model has been created.

The packages that I have installed are : Microsoft.EntityFrameworkCore.SqlServer (2.0.1), Microsoft.EntityFrameworkCore.Tools (2.0.1), and Microsoft.VisualStudio.Web.CodeGeneration.Design (2.0.1)

If I run this script on a different computer but in the same project and database it runs and completes building the model for the database.

When I run this command with -verbose it returns: Using project 'XXX'. Using startup project 'XXX'. Build started... Build succeeded.

Is there a reason that this would stop working?

1
0
11/17/2017 3:10:37 PM

Popular Answer

This happened because of my version of Visual Studio 17. When I upgraded to version 15.4.4 the ef models stopped being created. I had to add <RuntimeFrameworkVersion>2.0.3</RuntimeFrameworkVersion> to my <PropertyGroup></PropertyGroup> in my .csproj.

<PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <RuntimeFrameworkVersion>2.0.3</RuntimeFrameworkVersion>
  </PropertyGroup>
0
12/1/2017 4:10:25 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow