-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Double Check Microsoft.UI.Xaml Replaces Windows.UI.Xaml #76
Comments
Hey Lance, just so that I understand, how did you manage to get past the initial startup crash in Release mode? I mean, if you got to repro the crash with the context menu in Release mode I take it you found a way to avoid that initial crash somehow? 🤔 |
I have not been able to see the initial crash, but I did fix this crash. The controls library was not merging the resources, update Themes/Generic.xaml to: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<ResourceDictionary Source="Brainf_ckEditBox/Brainf_ckEditBox.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary> |
Also, app.xaml in the main project should be merging the Themes dictionary: <Application
x:Class="Brainf_ckSharp.Uwp.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
RequestedTheme="Dark">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>
<ResourceDictionary Source="Resources/Dictionaries/Brushes.xaml"/>
<ResourceDictionary Source="Resources/Dictionaries/IconPaths.xaml"/>
<ResourceDictionary Source="Resources/Dictionaries/MDL2Icons.xaml"/>
<ResourceDictionary Source="Styles/ButtonsStyles.xaml"/>
<ResourceDictionary Source="Styles/ClassicStyles.xaml"/>
<ResourceDictionary Source="Styles/MiscStyles.xaml"/>
<ResourceDictionary Source="Styles/TextStyles.xaml"/>
<ResourceDictionary Source="Brainf_ckSharp.Uwp.Controls.Ide/Themes/Generic.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application> |
Nevermind about that last one, when I merge themes in App.xaml, it now crashes at launch |
Oh, so I was merging the resource dictionaries wrong in the class library! 🤦♂️ If the startup crash you're getting is this:
Apparently this is fixed by leaving Which is weird, because apparently the app can do that just fine instead 🤷♂️ |
I have two side questions:
|
Ah, let me try that again for the Editbox styles (thanks Resharper). About the resources, you can't always rely on the downstream library consumer. You would think that having a style in App.xaml would make it available for everything, no matter where it comes from, but the external project is not just some XAML files that get compiled into the main project. Rather, the library gets compiled first (only aware of Windows.UI.Xaml), while the main project is compiling for Microsoft.UI.Xaml. I'm just making educated guesses at this point, based on the nature of the exceptions and the fact that it's .NET Native compilation stripping out the unreferenced parts. |
Launch is fixed, but the context menu exception is still happening. Not sure why it stopped for a while, needing to compile with WinUI types is a red herring. |
Just to double check, have you see my message in the other issue here? |
I see. This is weird. It makes me think there's this crash in the context menu on one end which we can investigate, and the one I'm seeing at startup which might be an SDK bug instead? I mean, you and I are running the same exact code, and for me the app is just exploding at startup, the only difference I can see is that I'm on 19041. Which would also explain why my other app Legere is exhibiting the same exact behavior - it explodes at startup in Release as well 🤦♂️ |
@LanceMcCarthy By the way, we have a ton of WinUI devs in our UWP Discord server, if you wanted to join we could talk there as well! We'd be happy to have you 😊 Right now there's Steven Brix (from the WinUI team) that's asking about this issue and I'm just relaying info from here, you could talk to him directly in there if you wanted. |
I'm going to take another stab at this in the morning, have to sign off. I'll have a 19041 VM spun up and will be able to hopefully be a little more helpful. [update] just got your latest message halfway through typing, lol. The two crashes probably do have two separate causes, but these kinds of things happen at the same time tend to make me suspect larger issue. |
Sounds great, that's awesome! No worries, I'll be looking forward for an update once you have the 19041 VM setup then, that'll definitely be useful! Thanks again 😊 And yeah I definitely agree with you that all these weird issues at once are very suspicious. |
I'm so tired that I completely missing ITemsPresenter and ContentPresenter, lol. in IdeView.xaml change:
To
|
I feel so stupid, I mixed those two up 🤣 Thank you so much for spotting this! Commented in the other issue 👍 |
Closing this as I think the issue is fixed now (can right click and it works just fine). Thank you again for the help! 😄 |
When right-clicking on the Textbox, the application crashes. The following output is available in the Windows Event Viewer
Event Viewer
Sergio has shared a screenshot (from DevCenter?) that further implicates the issue is in Windows.UI.Xaml in the crash
I'm surprised that Windows.UI.Xaml is being used instead of Microsoft.UI.Xaml, but I'm not well versed in how the WinUI sets the types under the covers. This could well be the expected output for a crash on a WinUI ContentPresenter.
The text was updated successfully, but these errors were encountered: