I am developing a library, which had been previously available under net6.0 and now i need to also provide it for net8.0.
When i switched
from <TargetFramework>net6.0</TargetFramework>
to <TargetFramework>net8.0</TargetFramework>
everything built and all tests passed.
But if I try to use multi-targeting <TargetFrameworks>net6.0;net8.0</TargetFrameworks> I am getting the following error:
Assets file 'C:\Users\USERNAME\source\repos\REPONAME\PROJNAME\obj\project.assets.json' doesn't have a target for 'net6.0'.
Ensure that restore has run and that you have included 'net6.0' in the TargetFrameworks for your project.
What i tried so far:
-Worked through this other thread, but without any success. While the issues there seem to be kinda similar, the solutions are not really helping me...
-Updated Visual Studio to 17.9.1.
-Read through some microsoft docs
-Exectue dotnet build to get more details
-Execute dotnet restore to get more details