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

Templated XAML controls for WinUI 3 apps with C# won't work and crash. #3893

Closed
blueblizza opened this issue Jan 6, 2021 · 7 comments
Closed
Labels
product-winui3 WinUI 3 issues team-Markup Issue for the Markup team

Comments

@blueblizza
Copy link

Describe the bug
Templated XAML controls for WinUI 3 apps with C# won't work and crash.

Steps to reproduce the bug
1.Create a "Blank App, Packaged (WinUI in Desktop) project template" in WinUI3
Follow the instructions as "Templated XAML controls for WinUI 3 apps with C#"
https://docs.microsoft.com/en-us/windows/apps/winui/winui3/xaml-templated-controls-csharp-winui-3

2.Press F5(Starting Debugging)

3.get error output and crashed
mincore\com\oleaut32\dispatch\ups.cpp(2122)\OLEAUT32.dll!76B4245F: (caller: 76B43D7F) ReturnHr(1) tid(57f8) 8002801D Library not registered.
D:\a\1\s\dev\MRTCore\mrt\Core\src\MRM.cpp(276)\MRM.dll!7A4DDEA1: (caller: 7A4DF6A8) ReturnHr(1) tid(57f8) 80073B17 NamedResource Not Found.
D:\a\1\s\dev\MRTCore\mrt\Core\src\MRM.cpp(403)\MRM.dll!7A4DF6C5: (caller: 7A48BF9E) ReturnHr(2) tid(57f8) 80073B17 NamedResource Not Found.
D:\a\1\s\dev\MRTCore\mrt\Core\src\MRM.cpp(755)\MRM.dll!7A4DF8E0: (caller: 7A48BF9E) ReturnHr(3) tid(57f8) 80073B17 NamedResource Not Found.
Exception thrown at 0x7761A892 (KernelBase.dll) in TemplatedXAMLDemo.exe: WinRT originate error - 0x80073B17 : 'NamedResource Not Found.'.
Exception thrown at 0x7761A892 in TemplatedXAMLDemo.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x02D7DE88.

Expected behavior
Build and run the app and you will see the templated control, with the background color and label specified.

Version Info

NuGet package version:
[Microsoft.VCRTForwarders.140 1.0.7]
[Microsoft.WinUI 3.0.0-preview3.201113.0]

Windows app type:
C# WinUI
Blank App, Packaged (WinUI in Desktop) project

Windows 10 version Saw the problem?
20H2 Build (19042.685) Yes
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context
my source repo: https://github.com/blueblizza/TemplatedXAMLDemo

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Jan 6, 2021
@stevenbrix
Copy link
Contributor

stevenbrix commented Jan 7, 2021

@blueblizza, does disabling mixed mode debugging fix this issue?

@stevenbrix stevenbrix added team-Markup Issue for the Markup team product-winui3 WinUI 3 issues and removed needs-triage Issue needs to be triaged by the area owners labels Jan 7, 2021
@stevenbrix stevenbrix added this to the WinUI 3.0 milestone Jan 7, 2021
@blueblizza
Copy link
Author

@blueblizza, does disabling mixed mode debugging fix this issue?

hi @stevenbrix , I change debugger type to "managed only" and this issue is fixed.
On the other hand, if I change debugger type to "native only", this issue reproduced.

@stevenbrix
Copy link
Contributor

stevenbrix commented Jan 8, 2021

Thanks @blueblizza for confirming. Do you need mixed mode or native only debugging? Our plan to address this is to change the default to managed debugging only

@blueblizza
Copy link
Author

Hi, @stevenbrix, I need mixed mode, because I also include a WinRT algorithm module in my project written in C++.

@stevenbrix
Copy link
Contributor

Gotcha 👍

Until the next release is out where we have this fixed, you can disable the exception in the exception settings:
image

@blueblizza
Copy link
Author

Thanks, @stevenbrix
This solution works well.

@stevenbrix
Copy link
Contributor

This is a dupe of #3868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product-winui3 WinUI 3 issues team-Markup Issue for the Markup team
Projects
None yet
Development

No branches or pull requests

2 participants