Class Library projects are dual targeted: NetCore 3.1 and Full 4.7.2
What happened
In an effort to start migration to .NET Core, we converted our class library projects to dual target NetCore 3.1 and Full 4.7.2. We've added our dual target class libraries as project references to the 4.7.2 MVC 5 web project. Everything compiles and runs fine. However, when editing our Razor views in Visual Studio, we get .NET Core errors when referencing objects in our dual target projects. The razor view editor appears to be using the NetCore 3.1 target instead of 4.7.2... If you drill-into an object reference in the razor view, it goes to the Core 3.1 flavor of our object instead of our full framework version.
Errors like: "The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runetime, Version=4.2.2.0....'. The type 'HttpRequest' is defined in an assembly that is not referenced... 'Microsoft.AspNetCore.Http.Abstractions'. etc. All related to our web project not having .NET Core references which shouldn't be a thing.
Our web project is targeting 4.7.2. We have manually edited the web projects' project references to utilize the AdditionalProperties="TargetFramework=net472" and SetTargetFramework to TargetFramework=net472. We have 4.7.2 set in the web.config for compliation and httpRuntime.
Versions
What happened
In an effort to start migration to .NET Core, we converted our class library projects to dual target NetCore 3.1 and Full 4.7.2. We've added our dual target class libraries as project references to the 4.7.2 MVC 5 web project. Everything compiles and runs fine. However, when editing our Razor views in Visual Studio, we get .NET Core errors when referencing objects in our dual target projects. The razor view editor appears to be using the NetCore 3.1 target instead of 4.7.2... If you drill-into an object reference in the razor view, it goes to the Core 3.1 flavor of our object instead of our full framework version.
Errors like: "The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runetime, Version=4.2.2.0....'. The type 'HttpRequest' is defined in an assembly that is not referenced... 'Microsoft.AspNetCore.Http.Abstractions'. etc. All related to our web project not having .NET Core references which shouldn't be a thing.
Our web project is targeting 4.7.2. We have manually edited the web projects' project references to utilize the AdditionalProperties="TargetFramework=net472" and SetTargetFramework to TargetFramework=net472. We have 4.7.2 set in the web.config for compliation and httpRuntime.
`
Any help would be much appreciated. Thank you.