NET Framework 4.x is a completely different runtime than NET Core (5/6/7/8). They are not compatible at runtime. Therefore you cannot reference a NET 5/6/7/8 project in a NET Framework assembly. That is the error you're getting.
If you are in the middle of running the upgrade assistant then generally you should run it on the projects with the least dependencies first and then work your way up. Once you upgrade a project then any project that hasn't been upgraded yet will generate this error most likely. You can ignore it (and therefore not be able to compile your code) until you upgrade the later project.
If you need to support multiple frameworks in the same project at the same time then you need to multi-target your project. To do that open the project file in the editor and change from <TargetFramework>
to <TargetFrameworks>
. Then specify each supported framework sesparated by semicolons. For example the following allows your project to support both .NET framework 4.7.2 and NET 8.
<TargetFrameworks>net472;net8.0</TargetFrameworks>
Now your project can be referenced by either NET 4.7.2 or NET 8 projects. A caveat to this however is that your project is compiled twice, once for each framework. Therefore your code has to support both frameworks. You cannot, for example, use C# features, like implicit usings, in your project because it isn't supported by NET 4.7.2. So you may either need to conditionally compile your code (using C# preprocessor directive) or avoid any features/types not supported by both frameworks. Additionally if you rely on any NuGet packages then they also need to support the frameworks. Sometimes you may run across a package that either requires 2 different versions (one for each framework) or doesn't work at all. In that case you have to conditionally reference the package. For example NET Framework can use System.ComponentModel.DataAnnotations
from the framework but the NET8.0 version has to use NuGet. It is tedious but hopefully only temporary while you migrate.