Does .net6.0 support xaml island?

Vishnu Gopalakrishnan 126 Reputation points
2022-09-16T00:54:01.523+00:00

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

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,821 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,346 questions
Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Jack J Jun 24,281 Reputation points Microsoft Vendor
    2022-09-16T01:55:34.043+00:00

    @Vishnu Gopalakrishnan , 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.


1 additional answer

Sort by: Most helpful
  1. Castorix31 81,461 Reputation points
    2022-09-16T07:26:13.737+00:00

    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

    0 comments No comments