Accessing string resource throws a false FileNotFoundException in Android
See original GitHub issueDescription
The first time any string resource is accessed in Android, this exception is thrown by the resource manager: System.IO.FileNotFoundException: ‘’
This does not break any functionality and can be ignored, but creates a developer experience problem. Developers who rely on exception trapping to detect runtime issues will find the feed to be polluted and may ignore real issues.
Steps to Reproduce
New MAUI App Enable Break When Thrown (Ctrl+Alt+E) ->All Common Language Runtime Exceptions Project properties->Resources->General->Create or open assembly resources New String resource {“Name”:“AResource”, “Value”:“A resource”}
Open MainPage.xaml.cs
Add this line to OnCounterClicked:
System.Diagnostics.Debug.WriteLine(Properties.Resources.AResource);
Build and run on Android. Tap the button, and the exception described above will be thrown.
Version with bug
Release Candidate 3 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12
Did you find any workaround?
Disable Break When Thrown->[System.Exception, System.IO.FileNotFoundException, System.IO.IOException, System.SystemException].
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:23 (9 by maintainers)
Top GitHub Comments
1.) Disabling the exception doesn’t work and 2.) this is a terrible exception to disable.
@jonathanpeppers can this be closed, then?