'how do I share a class between ASP .NET and Framework 4.6 applications?
I have two projects. One is targeted to Framework 4.6, another to .NET 6.0 When I try to create a reference, compiler produces an error "Project '..\Common\Common.csproj' targets '.NET6.0'. It cannot be referenced by a project that targets '.NETFramework,Version=v4.6'
How would you overcome the problem?
Solution 1:[1]
You can share a library if you build it for .NET Standard. To share a .NET Standard 2.0 library you'll need to target at least .NET Framework 4.6.1, which will be fine unless you need to deploy to Windows Vista or Windows Server 2008, which are both long out-of-support.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |

