0

I would like to multitarget my UserControl for both UWP and WinUI.

I found this link: https://nicksnettravels.builttoroam.com/upgrade-uwp-to-winui/ but it is really hard to migrate all the features because my project is a bit bigger and also sorting and adding using directives for both WinUI and UWP is an annoying job. I really hope there is a better way.

Is there any simple way or a tool that could do this?

FrozenAssassine
  • 1,392
  • 1
  • 7
  • 16

2 Answers2

2

I'm not sure if there's a simple way to multi-target UWP and WinUI. But I'm sure that I wouldn't do so. These are the reasons that comes to mind.

  • UWP and WinUI use different namespaces.
  • Latest (and future) .NET doesn't support UWP, so your code will be stuck with old .NET.
  • Even the WindowsCommunityToolkit has two different solutions for UWP and WinUI, so I guess there's no simple way to multi-target UWP and WinUI.
Andrew KeepCoding
  • 7,040
  • 2
  • 14
  • 21
1

Currently, there is no easier way to do this. UWP and WinUI3 apps looks very similar to each other, but they are actually different products. This is already mentioned in @Andrew KeepCoding's answer. So if you need to multitarget your code for both UWP and WinUI3, these works are necessary.

Roy Li - MSFT
  • 8,043
  • 1
  • 7
  • 13