Open wbokkers opened 3 years ago
Adding @alwu for FYI.
what does the controls
namespace map to? this worked fine for me locally, although I did hit the first chance exception you see. You can disable this exception, and your app should still run:
This is my solution structure:
There is no controls namespace. It's called local2 and it maps as follows: xmlns:local2="using:App1.Controls"
Not breaking on the exception works for me. But I can't leave the namespace declaration in the control.
So, I need to specify it as follows:
The auto generated code (below) does not work:
Just so I understand this properly, you're saying that the auto-generated code results in the following compiler error?
And you're able to workaround it by moving the local2
namespace declaration to the top of the file?
Yes, exactly!
Thanks @wbokkers, I'm glad you have a workaround, even though I'm sure it's annoying.
Do you know if this is a regression in WinUI3, or if this happens in WinUI2.x as well?
Never saw this happen with UWP, but I never tested with WinUI2, unfortunately.
@wbokkers I just tested this with a UWP project and it does look like it's happening, although maybe there was some regression in UWP that was missed?
The problem is still present in 1.0 release. The proposed workaround also works
Not breaking on the exception works for me. But I can't leave the namespace declaration in the control. So, I need to specify it as follows:
The auto generated code (below) does not work:
Still relevant for 1.2
Still relevant for 1.3 Preview1
Can someone explain to me the workaround?
I end up on
If I ignore exception I end with
Describe the bug After adding and using a Custom Control, I get a XAML error: WMC0610, The XAML Binary Format (XBF) generator reported syntax error '0x03e9'
Steps to reproduce the bug
Expected behavior The project should compile and run.
Screenshots![image](https://user-images.githubusercontent.com/4835617/99706013-c5651b80-2a9a-11eb-9b95-29707cf6263a.png)
Version Info
NuGet package version: [Microsoft.WinUI 3.0.0-preview3.201113.0]
Additional context I can compile and run when moving the XAML namespace declaration of the custom control style to the ResourceDictionary, but then I get this runtime error:![image](https://user-images.githubusercontent.com/4835617/99706784-dcf0d400-2a9b-11eb-9500-90ea5c689e33.png)
In the output window I see the following errors: D:\a\1\s\dev\MRTCore\mrt\Core\src\MRM.cpp(276)\MRM.dll!7C1ADEA1: (caller: 7C1AF6A8) ReturnHr(1) tid(65e4) 80073B17 NamedResource Not Found. D:\a\1\s\dev\MRTCore\mrt\Core\src\MRM.cpp(403)\MRM.dll!7C1AF6C5: (caller: 571BBF9E) ReturnHr(2) tid(65e4) 80073B17 NamedResource Not Found. D:\a\1\s\dev\MRTCore\mrt\Core\src\MRM.cpp(755)\MRM.dll!7C1AF8E0: (caller: 571BBF9E) ReturnHr(3) tid(65e4) 80073B17 NamedResource Not Found. Exception thrown at 0x76AE9AB2 (KernelBase.dll) in App1.exe: WinRT originate error - 0x80073B17 : 'NamedResource Not Found.'. onecore\com\combase\winrt\error\restrictederror.cpp(1016)\combase.dll!768623ED: (caller: 767C5126) ReturnHr(1) tid(65e4) 8007007E The specified module could not be found. Exception thrown at 0x76AE9AB2 in App1.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x02DDE268.