Scaffold-DbContext runs successfully but does not create any models
See original GitHub issueI am using Visual Studio community edition 2022 and trying to update my Models from database in EntityFrameworkCore 6 (I added new tables and modified some). When I run the Scaffold-DbContext
command, it runs successfully but does not produce any updates (or new classes) for the models. It created the models the first time, for that I had to add the following in the .csproj
file.
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
In the <PropertyGroup>
element. When I run it now (for update) it builds and runs successfully but doesn’t produce any updates to the models.
I am running the following command in the package manager console:
Scaffold-DbContext "Data Source=myserver;Initial Catalog=ccWebDb;Persist Security Info=True;User ID=*****;Password=*****" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Context DataContext -f
When I run this command, I get the following output
Build started...
Build succeeded.
Specify --help for a list of available options and commands.
Unrecognized command or argument 'C#'
Is there something I am missing here?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Try adding
-Verbose
to the commandTry using
dotnet ef
insteadUninstall old .NET Core SDKs if there are any and reinstall VS 2022.
Try sharing the actual command line used