Hi All,
So apparently in the future, the .NET framework will be dead!  It will only receive security patches.
I have a .NET framework 4.5 DLL and I am looking to migrate it so it will be compatible with .NET 5.
I see .NET V5.0.1 has already been released.

My question is, if I can successfully convert this DLL to .NET5, will I still be able to use the DLL in a .NET Framework application as it will still need to support .NET Framework for some time to come?
..Or should I just try and convert the DLL to use .Net Standard?
Thanks
You can’t consume a .NET 5 DLL in .NET Framework. You have to use .NET Standard 2.0

Thanks for the answer. So I should aim for .NET Standard then.. Thanks.
You should look at converting it to standard.
Ahh okay thanks. I was a bit weary because I heard .NET Standard was going away with .NET 5 so I wondered if it was possible to port directly to .NET 5.
Thanks for the answer.

It’s crazy to me that .NET STANDARD 2.1 is not compatible with .NET framework. How do you call it standard without supporting 99% of the legacy .NET code out there?
But yes, the advice here is correct. Checkout https://dotnet.microsoft.com/platform/dotnet-standard for compatibility details.

It supports all the others except unity. This is why they had to break away as full framework was holding everything back. If they hadn’t taken the steps to unify with 5 and 6 we’d still be getting new standards for those runtimes.

Thank you for this. Wow, just been flipping between the drop-downs on that page and yeah.. Like you say, its shocking that .Net Standard 2.1 does not support .net framework at all.
You can’t convert ‘the DLL’ itself (without disassembling it first, which I assume since your asking this, is probably beyond the scope of what you want to do)…

You’d have to get the source code and recompile it…
Sorry I should have made it clear. Yes, I have the source project. I just wanted to know If I was able to successfully migrate the project to .NET 5 could the same DLL still be used in a .NET framework application.
Just retarget the Framework project to .NET Standard 2.0 and you can use it in both Framework and Core/.NET 5 apps.
Thanks.

There is a compatibility shim for using .NET Framework dlls on .NET Core, but unfortunately vice-versa doesn’t exist 🙁
You mean https://www.nuget.org/packages/Microsoft.Windows.Compatibility ?
No.

Your best bet is to create the DLL in .NET Standard 2.0 (not 2.1) – then you will be able to use it with .NET Core >= 2.0 and .NET Framework >= 4.6.1.
If you absolutely need to use the DLL with older Core/Framework versions, you can target it to lower versions of Standard as per this table – but be aware that versions of Standard < 2.0 are quite limited in what they can do.

source