You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When having a ResourceDictionary in a page with for example double values and you use them in the page it will crash the app on iOS and Android. On Windows elements where I set HeightRequest="{StaticResource MyHeightValue}" will not show up.
This only happens in Release, in Debug it works. ANd for iOS and Android I have only tested on physical devices.
On iOS i found this error message when I open the console via XCode: MainPage.InitializeComponent: Store local stack type mismatch 3 4
It worked fine with .NET 8. We found this problem when testing our app after updating to .NET 9.
Steps to Reproduce
Create a new .NET MAUI app
Add a ResourceDictionary in the MainPage.xaml
Add a double value to the ResourceDictionary
Use the value as Height for the bot image.
Switch to release configuration
Deploy the app to the device.
<ContentPagex:Class="StaticResourcesBug.MainPage"xmlns="http://schemas.microsoft.com/dotnet/2021/maui"xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<ContentPage.Resources>
<ResourceDictionary>
<x:Doublex:Key="BotHeight">185</x:Double>
</ResourceDictionary>
</ContentPage.Resources>
<ScrollView>
<VerticalStackLayoutPadding="30,0"Spacing="25">
<ImageAspect="AspectFit"HeightRequest="{StaticResource BotHeight}"
SemanticProperties.Description="dot net bot in a hovercraft number nine"Source="dotnet_bot.png" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>
Description
When having a ResourceDictionary in a page with for example double values and you use them in the page it will crash the app on iOS and Android. On Windows elements where I set HeightRequest="{StaticResource MyHeightValue}" will not show up.
This only happens in Release, in Debug it works. ANd for iOS and Android I have only tested on physical devices.
On iOS i found this error message when I open the console via XCode: MainPage.InitializeComponent: Store local stack type mismatch 3 4
It worked fine with .NET 8. We found this problem when testing our app after updating to .NET 9.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/dhindrik/StaticResourcesBug
Version with bug
9.0.21 SR2.1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.100 SR10
Affected platforms
iOS, Android, Windows, I was not able test on other platforms
Affected platform versions
iOS 18.2, Android 14, WIndows 10.0.19041.0
Did you find any workaround?
Put the values on each place instead of in a ResourceDictionary.
Relevant log output
The text was updated successfully, but these errors were encountered: