0

I have used the following example to host a standard UWP control in a WPF app using XAML Islands: https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/host-standard-control-with-xaml-islands

But if I get to the point:

  1. In your WPF project, right-click the Dependencies node and add a reference to your UWP app project.

I get the following error:

Unable to add a reference to project…

Why isn't this working?

Wouter
  • 2,170
  • 1
  • 28
  • 58
Yonnr
  • 81
  • 8

1 Answers1

2

In your WPF project, right-click the Dependencies node and add a reference to your UWP app project.

I'm afraid you could not add the UWP project to WPF App (.NET Framework). Because it does not contain Dependencies option.

I tried create .NET Core WPF App(if you want to create a WPF App (.NET Core) project, you must first install the latest version of the .NET Core 3 SDK.) app and add UWP reference, and it's success. And Please make sure the target version and minimum version are both set to Windows 10, version 1903 or later.

Nico Zhu
  • 32,367
  • 2
  • 15
  • 36
  • This is not the solution, the official documentation clearly states it should work with NET Framework as well. https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/host-standard-control-with-xaml-islands – Wouter Sep 14 '20 at 07:03
  • Microsoft documentation states XAML Islands only works with .Net Core 3.x, not Net Framework or Net 5. I’d assume late 2021 XAML Islands good for Net 5/6 when Project Reunion 1.0 and WinUI 3 formally released (though not clear) – Moon Waxing Jun 13 '21 at 10:22
  • Hi, are there any updates related to XAML Islands support for .NET 6? I was trying to make it work today but it was not successful. If you could provide any examples or link for docs/roadmaps...I would be grateful. Thanks – Michal Zhradnk Nono3551 Mar 21 '22 at 16:20