Is there a way to convert Windows Desktop applications to Universal UWP and Vice Versa?

10,069

Solution 1

You answered most of your question yourself already. You have the following options (considering you want to continue using your .NET/XAML skillset as you mention WPF and are not looking into a web alternative):

  • Write a desktop app in WPF: you want to support Windows 7 or need features that are currently not available yet in UWP (some APIs, sandboxed UWP, ..). As you mentioned, you can use the Desktop Bridge to bring the app to the Windows 10 store as well with the downside of not running on mobile, HoloLens, Xbox (as of today). Then again, WPF doesn't run on those platforms either.
  • Write the app from scratch in UWP: run on Windows 10 on all available platforms. Yes, you will leave the Windows 7 users in the cold but not that Windows 7 is already in the extended support block so people will have to upgrade at some point.
  • Write the app from scratch with Xamarin.Forms, creating a single app that runs on Windows 7 (WPF), UWP, Android and iOS. Note that this is a somewhat different XAML dialect right now, but XAML Standard is working on unifying the dialects in the future.

A bit more work is to share most of your code with .NET Standard or PCL libraries and write multiple native UI's on top of it (which can be done with Xamarin).

If you're looking for longer term support pick either UWP (the way forward for Windows) or Xamarin.Forms.

Solution 2

I would go UWP and use Xamarin forms if I were you.

Using Xamarin you can write the one UWP app and deploy to Windows, Android, and iOS.

Solution 3

Try Microsoft's Desktop Bridge tool for UWP. Using the Desktop Bridge, you can gradually migrate your code to the Universal Windows Platform (UWP) to reach every Windows 10 device, including phones, Xbox One, and HoloLens

Using Desktop bridge tool, you can

  • Convert MSI to APPX package
  • Upload your Desktop app (after conversion to APPX package) to Store
  • Take advantage of UWP features like Live tiles, Push Notification and many more)

And, for Android and iOS app try Xamarin. UWP project cannot converted to xamarin project. You've to write seperate project. I recommend you to try Xamarin.Forms which allows you to boild UWP, Android and iOS app with shared code.

Share:
10,069
TheEthan8or
Author by

TheEthan8or

Updated on June 05, 2022

Comments

  • TheEthan8or
    TheEthan8or almost 2 years

    In Visual Studio I am trying to decide which type of application I should start with. I want to make it available to as many devices as I can.

    If I make a Windows desktop application (.NET/WPF), I could convert it to a UWP but it only targets desktop applications, which is pointless device-wise.

    But if I make a UWP, it would work with Microsoft devices, but not ones running a Windows older than Windows 10. A lot of people still use older versions of Windows, and I would rather make a Windows desktop application than limit the use to a specific version of Windows.

    It would also be cool to be able to make it work on other devices like Android.

    QUESTIONS: Is there a way to convert a Desktop application to a Universal UWP (with or without the code)? Is there a way to convert a Universal UWP to a Desktop application (or make it run on older Windows machines)? If not, what would be the best application type and why?

    Also, is there a different application type I should use instead that I'm not thinking of?

    NOTE: Microsoft Project Centennial converts Desktop applications to UWP's, but they only work on desktop machines.