I am getting a FileLoadException when trying to scaffold an existing database now. I've done it successfully in the past numerous times, but after upgrading to .net6, VS2022 and Win11 (not all at the same time), I am getting an error. After doing a successful build on a test project, I get this error:
Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'C:\Users\GeorgeHandlin.dotnet\tools.store\dotnet-ef\6.0.3\dotnet-ef\6.0.3\tools\netcoreapp3.1\any\tools\netcoreapp2.0\any\ef.dll'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'C:\Users\GeorgeHandlin.dotnet\tools.store\dotnet-ef\6.0.3\dotnet-ef\6.0.3\tools\netcoreapp3.1\any\tools\netcoreapp2.0\any\ef.dll'
I have tried uninstalling the tool and reinstalling it without success. I created a Win10 VM, loaded up VS2022, installed the CLI tool and was able to successfully scaffold the database I was trying to work with on my main machine. I have also tried clearing out what seemed to be the relevant directories in .nuget\packages.