question

VishnuGopalakrishnan-8317 avatar image
0 Votes"
VishnuGopalakrishnan-8317 asked JackJJun-MSFT commented

Does .net6.0 support xaml island?

I wish to use XAML island for the C# winform application in .net6.0. Does it support it?

windows-uwpwindows-formsdotnet-standard
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JackJJun-MSFT avatar image
0 Votes"
JackJJun-MSFT answered VishnuGopalakrishnan-8317 commented

@VishnuGopalakrishnan-8317, Welcome to Microsoft Q&A,

Does .net6.0 support xaml island?

No, based on my test, It will throw the error when I installed the nuget-package Microsoft.Toolkit.Forms.UI.Controls and rebuild the project in .NET 6.0 winform project.

Error:

241794-image.png

If I changed .NET Framework to .net core 3.1, it rebuilds well without the error.

Therefore, it is not supported in .net 6.0.

Hope this could help you.

Best Regards,
Jack


If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (4.8 KiB)
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you.
I followed the same link. My problem is that my user control namespace is not detected in the Winform. The user control is defined in the UWP dll and winform tries to host via XAML Island.

0 Votes 0 ·
VishnuGopalakrishnan-8317 avatar image VishnuGopalakrishnan-8317 VishnuGopalakrishnan-8317 ·

Sorry, I doubted this too.

Using XAML Islands to host WinRT XAML controls in WPF and Windows Forms apps is currently supported only in apps that target .NET Core 3.x. XAML Islands are not yet supported in apps that target .NET, or in apps that any version of the .NET Framework.

https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/xaml-islands

Using XAML Islands (wrapped controls or WindowsXamlHost) to host UWP XAML controls is supported only in apps that target .NET Core 3.x. XAML Islands are not supported in apps that target .NET, or in apps that target any version of the .NET Framework.

https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/host-standard-control-with-xaml-islands

So does XAML Island has support in .net 6.0?






0 Votes 0 ·
JackJJun-MSFT avatar image JackJJun-MSFT VishnuGopalakrishnan-8317 ·

@VishnuGopalakrishnan-8317 ,Sorry for that, after testing, I find that XAML Island has support in .net 6.0. Now I have updated my answer and you could have look. If you want to use it in .NET 6.0, you could submit an issue in the Github.



Thanks for your understanding.

0 Votes 0 ·
Castorix31 avatar image
0 Votes"
Castorix31 answered

No, as the doc says :

Using XAML Islands (wrapped controls or WindowsXamlHost) to host UWP XAML controls is supported only in apps that target .NET Core 3.x. XAML Islands are not supported in apps that target .NET, or in apps that target any version of the .NET Framework.

There is XAML Islands for .NET 5, but I did not test it


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.