'Use .Net framework 4.7.2 in .net 6 application

I am trying to find out if it is possible to use a .Net Framework 4.7.2 assembly in another .Net 6 libraries or .Net 6 application. I tried this with some sample projects, and at least I could add a reference to a .NET 4.7.2 in .NET 6 library or application. But based on some posts at Stack Overflow (Can I add a reference to a .NET Framework DLL from a .NET 6 project?) and reading the .Net compatibility, it seems not to be possible.

So is it possible or not?

To be honest, the huge amount of different .NET flavors and the continuous renaming makes it really hard to see the wood for the trees.



Solution 1:[1]

No, you can't use .NET 4.x code on .NET 6. If you own the code, I suggest migrating it to .NET 6 instead.

Normally, implementing .NET Standard 2.0 as a target on your .NET Framework project would allow you to use it on a .NET 6 project, but if you can target .NET Standard, you might as well target .NET 6 directly.

Solution 2:[2]

There is a compatibility mode in .NET 5+ and .NET Core 3.1 that should allow you to do what you want. Check it out here!

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 Sedat Kapanoglu
Solution 2 tommasodotNET