This is a question with a complex answer.
Let me blunt. It is highly likely the answer to your question will be no, it can't be done, but that is because you have a very specific library in mind. The real answer is that it depends on the library in question, but chances are mostly geared towards this not working.
Yes, you can load .NET Framework assemblies into .NET Core 5 and 6.
However, depending on what that library does, and probably more important, what dependencies it has aka other libraries it wants to drag with it, it might not work properly for any sizable complex library.
There are classes that doesn't exist in .NET 5+, or even just single method overloads or properties. Depending on the exact parts of .NET Framework you access, it may in fact just be missing outright in .NET 5+.
There is more information here.
Your best option is probably to try to:
- Re-compile the library for your particular .NET version (be it 5 or 6)
- Re-compile the library targeting .NET Standard 2.1, as .NET 5+ is compatible with that
However, you might in fact just get into the exact same problem with that re-compile as you will have to deal with those changed bits. But, then at least you would have more knowledge about what would and wouldn't work, and you have a chance to fix it.
If it's not your library to change, either replace it, or try and hope for the best.