Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scaffold-DbContext doesn't produce models

I am trying to run Scaffold-DbContext to generate some models from an old system. I am running the following command:

Scaffold-DbContext "Data Source=localhost\SQLEXPRESS;Initial Catalog=MAINT_TRAINING;Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer

The problem is that I get absolutely no output... No models, no errors, no confirmations...

The tables in the DB all have primary keys.

Am I doing something wrong?

like image 538
Matthew Goulart Avatar asked Aug 31 '25 03:08

Matthew Goulart


1 Answers

You may be hitting issue #10298. Try adding the following to your *.csproj:

<PropertyGroup>
  <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
like image 70
bricelam Avatar answered Sep 02 '25 18:09

bricelam