-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WinUI 3 App - InitializeComponent Fails with WinRT Error and TypeInitializationException #9606
Labels
Comments
microsoft-github-policy-service
bot
added
the
needs-triage
Issue needs to be triaged by the area owners
label
May 2, 2024
Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you! Open similar issues:
Closed similar issues:
|
codendone
added
team-Markup
Issue for the Markup team
and removed
needs-triage
Issue needs to be triaged by the area owners
labels
May 3, 2024
Can you attach a repro project? |
I have attached the sample |
microsoft-github-policy-service
bot
added
needs-triage
Issue needs to be triaged by the area owners
and removed
needs-author-feedback
Asked author to supply more information.
labels
May 8, 2024
Any update on this? |
codendone
added
area-ProjectSystem
and removed
needs-triage
Issue needs to be triaged by the area owners
labels
May 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Describe the bug
This is a minimal WinUI 3 desktop app written in C++, hosting a WinUI 3 runtime component written in C# to display the Community Toolkit DataGrid.
When attempting to declare the DataGrid in a XAML file, InitializeComponent fails with the WinRT error
0x802B000A
: 'Cannot create instance of typeMicrosoft.UI.Xaml.Controls.XamlControlsResources
'.When loading the DataGrid in the code-behind, a
System.TypeInitializationException
occurs, with the internal exception being aNullReferenceException
: 'Object reference not set to an instance of an object'.Steps to reproduce the bug
However, our host application is written in winrt/c++, which means we have to load the components as external winui3-runtime components.
Expected behavior
WinRT Error and TypeInitializationException should not occur.
Screenshots
No response
NuGet package version
None
Windows version
No response
Additional context
Any suggestions for resolving this issue?
The text was updated successfully, but these errors were encountered: