InitializeComponent throws System.IO.FileNotFoundException #26166
Labels
area-xaml
XAML, CSS, Triggers, Behaviors
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
Milestone
Description
New MAUI app throws FileNotFoundException when launched on Android 14.
The issue has been reported before at #7002 and #10821.
Clearing the .
vs folder
or adding<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
as suggested by the previous issues seems to have no effect.I reproduced in Visual Studio Preview 17.13.77.2683 and Visual Studio 17.10.341.11210.
Steps to Reproduce
Expected outcome: App launches with debugger attached without any exceptions
Actual outcome: App launches with debugger, but will break on InitializeComponent() in App.xaml.cs. After continuing past 5 exceptions the App runs as expected.
Link to public reproduction project repository
https://github.com/icefire1/ResourceFileNotFound9
Version with bug
9.0.0-rc.2.24503.2
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 14
Did you find any workaround?
Set
Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture
before InitializeComponent runs. E.g. in CreateMauiApp().If setting culture to invariant is not a viable option it is possible to get around the exception by ensuring *.resources.dll exists in the build output. One horrible way of achieving this is by:
Relevant log output
Full Debug output can be seen in the repro repo ResourceFileNotFound9/ResourceFileNotFound9.Droid/debug-output.txt
The text was updated successfully, but these errors were encountered: