As I know that the .net-core can run UWP, can we build or write UWP with Core? I've read the https://msdn.microsoft.com/en-us/magazine/mt694084.aspx
Asked
Active
Viewed 3.1k times
38
-
2It seems you will be able to run [UWP on .net core 3.0](https://www.hanselman.com/blog/AnnouncingNETCore21RC1GoLiveANDNETCore30Futures.aspx) – ghord May 15 '18 at 07:02
-
@ghord that is a slight technicality. You can run UWP on .NET Core today. If I understand this correctly, UWP is .NET Standard 2.0 compliant, which uses reference assemblies during design and development. When it actually builds and runs, it uses its runtime assemblies now, and pulls these assemblies from .NET Core, not .NET Framework. UWP does NOT run on the .NET Core App runtime like a .NET Console does, if that makes sense. I doubt it does. It's very confusing. ;) – Mike-E May 15 '18 at 17:27
-
@Mike-EEE From what I understand, In build 2018 they announced Desktop Packs, which will allow you to run WPF/WinForms/UWP on .Net Core 3.0 – ghord May 16 '18 at 05:20
-
Right @ghord there is .NET Core support. The distinction here is that these packs enable those products to run on .NET Core 3.0 runtime assemblies, not the .NET Core 3.0 application runtime. That is, you will not be able to run WPF/WinForms/UWP on Linux or Mac which is made possible by the application runtime that I am referring to here. You will, however, get all the performance benefits and extra APIs/tooling from .NET Core 3.0 on Windows, however. This is, again, if I understood everything correctly. – Mike-E May 16 '18 at 09:59
-
@ghord In blog post I linked Scott Hanselman clearly says "You can run WinForms and WPF on .NET Core 3 on Windows". For me the reason it wont run on Mac/linux is that there are simply no apis to PInvoke there (which winforms and WPF both need to work). – ghord May 16 '18 at 10:13
-
Scott clearly does say that @ghord but does that mean .NET Core via the runtime assemblies like the current .NET Core UWP or does that mean you will be able to use the `netcoreapp3.0` TFM in a .NET Core application project and use WPF/WinForms/UWP there? I guess this is where the confusion is, and we will need to see how the SDK is designed to know for sure. As an example, [here is a .NET Core UWP application](https://github.com/Microsoft/Windows-universal-samples/blob/master/Samples/BackgroundTransfer/cs/Tasks/Tasks.csproj) and there is no mention of `TargetFramework` or `netcoreapp2.x` TFMs. – Mike-E May 16 '18 at 15:30
1 Answers
32
UWP apps will be able to use libraries you have created in .net core as long as you target the .netstandard1.6 (or higher) framework moniker.
UWP is only for the windows ecosystem.

Nick Acosta
- 1,890
- 17
- 19
-
Does that mean that with Core we can't create UI app any else at moment , right? – TeeTracker Jul 05 '16 at 07:24
-
6
-
7Sorry but this is so confusing; .NET Core is cross-platform but UWP is Win10 only. How can this be? Isn't this is contradictory? I mean, if it can ran on .NET Core doesn't this mean it's Cross-Platform? – Pap Mar 08 '17 at 16:27
-
13Pap: You can use .net core to create an app targeting UWP, but UWP isn't part of .net, it's part of Windows. This is like how you can use standard C or C++ (cross-platform languages and standard libraries) to create a platform-specific app targeting Windows or Mac or Linux or ... The language, runtime, class libraries are cross-platform, but you're using them to talk to OS APIs which are not. – Max Strini Mar 09 '17 at 00:51
-
@MaxStrini Is it possible to target UWP using dotnet cli? If it isn't, is it worth expecting Microsoft to implement it in future? I'm not aiming for cross-platform, js. – Fᴀʀʜᴀɴ Aɴᴀᴍ Feb 26 '18 at 08:11
-
5I am not sure if this is accurate anymore? It seems that UWP is compatible with .NET Standard 2.0, not .NET Core. Or rather, .NET Core is built to be .NET Standard 2.0 compliant, and UWP uses those reference libraries when building. In any case this is mass confusing, indeed. :P – Mike-E May 15 '18 at 17:24
-
1Thanks Mike-EEE, I updated my answer to read .net standard 1.6 (or higher) – Nick Acosta May 15 '18 at 18:30
-
But, platform UNO is a .NET core technology that can be run on any platform. – Christian Findlay Nov 24 '18 at 03:56
-
3@Mike-EEE is right. This statement doesn't make sense: "UWP apps will be able to use libraries you have created in .net core as long as you target the .netstandard..." If you create libraries targeting .net standard then these libraries are not .net core libraries. They can be used with .net core or any other runtime supporting .net standard. – Charles Roddie Dec 08 '18 at 14:29