Skip to content
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

Unpackaged C++-applications can't activate C#-runtime components #331

Open
pcruche opened this issue Apr 5, 2024 · 0 comments
Open

Unpackaged C++-applications can't activate C#-runtime components #331

pcruche opened this issue Apr 5, 2024 · 0 comments

Comments

@pcruche
Copy link

pcruche commented Apr 5, 2024

Steps to reproduce:

  • Clone the repository
  • Open the "CustomControls" sample solution
  • Select CppAppUnpackaged as startup project
  • Run
  • The app halts with an unhandled exception during Application::Start

The error message in the UnhandledException-handler is "Cannot create instance of type 'Microsoft.UI.Xaml.Controls.XamlControlsResources' [Line: 17 Position: 37]"

Setting a breakpoint in base.h, factory_cache_entry, I think that this is related to the activation of "WinUIComponentCs.WinUIComponentCs_XamlTypeInfo.XamlMetaDataProvider".

Apparently, it's not possible currently to activate C#-components in an unpackaged Cpp-application; at least not according to the current documentation and provided samples.

Environment: Visual Studio Community 2022 17.9.4.
This happens with the NuGet packages in the versions referenced in the sample project, but also with up-to-date packages.

Update: the x86 build works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant