Reputation: 3079
New to UWP. I like the idea that it is difficult (or impossible) to decompile UWP application because it is built on the .NET Native/Core... I'm wondering if is possible/a way to use UWP dll in normal .NET Framework?
I thought perhaps I could code my logic and stuff in UWP dll instead and leave all the UI stuff intact in my .NET application... so far everything I read online are the other way around, people try to reuse their existing .NET Framework libraries in UWP.
Upvotes: 0
Views: 1430
Reputation: 1143
You can write a DLL targeting .Net Standard version 1.0 all the way up to 2.0 (which is the max that UWP supports in the Fall Creators Update). Once your DLL is ready, you can use it in UWP and .Net framework.
Look at the chart in this page https://learn.microsoft.com/en-us/dotnet/standard/net-standard it will help you decide which .Net Standard version to target and shows you the compatibility with various other .Net tech.
This is what I do now when I need to share code between UWP, WPF, ASP.NET, and other types of projects.
Be advised that sometimes this is not very easy, as it might require you to make some changes to your code in order for it to be compatible with .Net Standard.
I strongly suggest you look into .Net Standard as it will help you a lot.
Upvotes: 1