question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accessing string resource throws a false FileNotFoundException in Android

See original GitHub issue

Description

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”} image

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:closed
  • Created a year ago
  • Reactions:1
  • Comments:23 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
DRAirey1commented, Jan 27, 2023

@hlavli I think the workaround is to prevent the debugger from breaking on certain exceptions:

1.) Disabling the exception doesn’t work and 2.) this is a terrible exception to disable.

2reactions
jstedfastcommented, May 9, 2023

@jonathanpeppers can this be closed, then?

Read more comments on GitHub >

github_iconTop Results From Across the Web

.net - Xamarin.Forms + .resx string resources - System.IO. ...
When I now want to access any of my string resources from one of my app projects, ResourceManager.GetString throws this Exception: System.
Read more >
How to Fix the FileNotFoundException in Java.io
The FileNotFoundException is a checked exception in Java that occurs when an attempt to open a file denoted by a specified pathname fails....
Read more >
java.io.FileNotFoundException in Java
FileNotFoundException which is a common exception which occurs while we try to access a file. FileNotFoundExcetion is thrown by constructors ...
Read more >
How to Handle the FileNotFoundException in C# | Rollbar
The FileNotFoundException occurs in C# when the system is unable to locate a file when the program is executed. Learn how to handle...
Read more >
Access documents and other files from shared storage
moveToFirst() returns false if the cursor has 0 rows. Very handy for ... val displayName: String = it.getString(it. ... throw FileNotFoundException() }
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found