Issue
I wrote an App with XAMARIN. Currently I test the App with Android emulator.
Sometimes it happens, if I start debuggin of the App, I get a crash with Message:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
This crashes happens before the UI in emulator shows any view. I just have a white screen if the crash happens.
Unfortunately, there is no information for this message. Is there a chance to get any information which line of code raised this error? Can I get any Stack trace ore something else? Im new in debugging with visual studio.
Solution
In VS, try this:
- Go to menu
Debug > Windows > Exception Settings
or typeCtrl-Alt-E
. - Tick the box on the line that says "Common Language Runtime Exceptions".
- Start a Debug session (F5).
- VS will now break on any exception that occurs, even the ones that have a
try...catch
. - You may need to ignore a few exceptions (press F5 to proceed) to get to the actual location of your problem.
- Analyze the problem and write a fix.
- To reset VS back to its normal behavior, right click on the line "Common Language Runtime Exceptions" and select "Restore Defaults".
Answered By - Peter B
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.