Just installed a power tool extension on Visual Studio and suddenly entity framework migration for my project stopped working. .Net core 2.1.1 runtime seems to be removed or upgraded somehow.
When I run "Add-Migration Initial", I got the following error:
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.1.1' was not found.
- Check application dependencies and target a framework version installed at:
- Installing .NET Core prerequisites might help resolve this problem:
- The .NET Core framework and SDK can be installed from:
- The following versions are installed:
2.0.9 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.5 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.1.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
2.2.0 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Add the "GenerateRuntimeConfigurationFiles" to project file,
Check this link for more details:
EF needs the *.runtimeConfig.json file to get framework roll forward behavior. Class libraries don't generate a *.runtimeConfig.json by default. The Design package basically adds this line to your project. If none of that happens, we fall back to running on the exact version the library is compiled against which fails if it's not installed.