VS 2019 Pro
Updated today.
Win 10
Created a new C# MVC site.
.NET Framework 4.8
Added User Authentication using a SQL server database.
Site creates, compiles no errors
Went to Models -> Add New Item -> ADO.NET Entity Model -> code first from database.
Compiled, no problem.
Went to Controllers.
Add new controller -> MVC5 Controller with views, using Entity Framework
Hit GO, get Error Message:
---------------------------
Microsoft Visual Studio
---------------------------
Error
There was an error running the selected code generator:
'Entity Framework 5 or later is required for the current operation but not available. Make sure the project has a reference to Entity Framework version 5 or greater.'
---------------------------
OK
---------------------------
Now suddenly my database model is broken (it just compiled earlier), claiming the following errors:
Error CS0246 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
Error CS0234 The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
Error CS0246 The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'DbSet<>' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'DbModelBuilder' could not be found (are you missing a using directive or an assembly reference?)
Error CS1729 'DbContext' does not contain a constructor that takes 1 arguments
I have created sites this way for 10 years, what has Microsoft broken now? More important, how do I fix it?
update: Comparing my packages.config, before and after, I notice that clicking "Add" in the wizard changes one line:
<package id="EntityFramework" version="6.4.4" targetFramework="net48" />
//changes to
<package id="EntityFramework" version="6.1.3" targetFramework="net48" />
So it's attempting to DOWNGRADE the Entity Framework from 6.4.4 to 6.1.3.