Microsoft-ui-xaml: Cannot use winui in a .net framework application in a XAML island

Created on 4 Jun 2019  Â·  9Comments  Â·  Source: microsoft/microsoft-ui-xaml

Describe the bug

Using winui in a .net framework application (XAML island) does not work

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Add winui nuget package
  2. Observe that the Microsoft.UI.Xaml namespace is not present

Adding the .winmd and .dll files manually allows the application to build but it crashes because it cannot locate the ms-appx:///Microsoft.UI.Xaml/Themes/19h1_themeresources.xaml file.

Expected behavior

winui is usable in a XAML island

Screenshots

Version Info

NuGet package version:

Microsoft.UI.Xaml v2.2.190430003-prerelease


| Windows 10 version | Saw the problem? |
| :--------------------------------- | :-------------------- |
| Insider Build (xxxxx) | |
| May 2019 Update (18362) | X |
| October 2018 Update (17763) | |
| April 2018 Update (17134) | |
| Fall Creators Update (16299) | |
| Creators Update (15063) | |
| Anniversary Update (14393) | |


| Device form factor | Saw the problem? |
| :-------------------- | :------------------- |
| Desktop | X |
| Mobile | |
| Xbox | |
| Surface Hub | |
| IoT | |

Additional context

area-Islands bug team-Reach

All 9 comments

@ocalvo Can you offer any advice here? I think this scenario should work, but I don't remember if all the tooling improvements you were looking into are in yet.

We have a PR open on the toolkit here to try and resolve this, but I believe the current approach breaks MSIX support, so I think it still needs more work.

These are 2 independent issues. Both are needed to improve the user experience with MUXC and Islands.

Get Outlook for Androidhttps://aka.ms/ghei36


From: Michael Hawker MSFT (XAML Lllama) notifications@github.com
Sent: Thursday, June 6, 2019 11:00:52 AM
To: microsoft/microsoft-ui-xaml
Cc: Oscar Calvo; Mention
Subject: Re: [microsoft/microsoft-ui-xaml] Cannot use winui in a .net framework application in a XAML island (#798)

We have a PR open on the toolkit herehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fwindows-toolkit%2FMicrosoft.Toolkit.Win32%2Fpull%2F119&data=02%7C01%7COscar.Calvo%40microsoft.com%7C2bf3b4998e2c4ba6b98408d6eaa8ea62%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636954408559410303&sdata=JH%2BdLQNvRdgJ5Af2b8873srIukJTH9E%2BfLuypndy41I%3D&reserved=0 to try and resolve this, but I believe the current approach breaks MSIX support, so I think it still needs more work.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fmicrosoft-ui-xaml%2Fissues%2F798%3Femail_source%3Dnotifications%26email_token%3DAAP6UPTQSSGGXIPA5WT3ESTPZFGFJA5CNFSM4HS2LYKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXDVMEQ%23issuecomment-499602962&data=02%7C01%7COscar.Calvo%40microsoft.com%7C2bf3b4998e2c4ba6b98408d6eaa8ea62%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636954408559410303&sdata=YEyD38a%2FKmIKZk5enTb56%2F08XqCGwGCzFiDlEYiOhaA%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAP6UPVTUBOBVT2OJ24DBELPZFGFJANCNFSM4HS2LYKA&data=02%7C01%7COscar.Calvo%40microsoft.com%7C2bf3b4998e2c4ba6b98408d6eaa8ea62%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636954408559420298&sdata=jH39ew1zI1r1HT63woJJYW4CyVoG1V8%2F0XbXETFzwDU%3D&reserved=0.

Any idea when this issue will be resolved? I can get an older version of the winui library to work if I use it in a packing app (unpacked version does not work due to missing resources.pri file). However, the latest release crashes with a System.IO.FileNotFoundException and the following stack trace:

System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
Microsoft.UI.Xaml.Controls.XamlControlsResources..ctor()

@lhak have you tried the most recent nuget packages from the toolkit for XAML Islands? There's an example and instructions that's kept up-to-date you can try too.

If you're still having issues, can you attach a sample project to an issue on our repo here. Thanks!

@michael-hawker Yes, I used the most recent nuget package. The page you linked to explicitly talks about .net core. So far, I have been using .net framework. Do you know if winui is just not supported for .net framework, or if this is indeed a bug?

@marb2000 @ocalvo do you have a sample for this somewhere?

Just a quick update: winui v2.2.190822001-prerelease works again (but still only in a packaged app) if the files are manually copied to the project. However, one issue I also noted previously is that all reveal and acryllic effects are missing once the XamlControlsResources object is initialized.

System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD)
Microsoft.UI.Xaml.Controls.XamlControlsResources..ctor()

My colleague gets exactly this issue, any ideas?

Was this page helpful?
0 / 5 - 0 ratings