Forum Visual Studio

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Visual Studio Debugging OnUnhandledException NullReferenceException

AntoineBTnSAntoineBTnS USMember
edited March 2016 in Visual Studio

Hi,

I'm facing the following issue during the development of a Xamarin Android application :

Exception in OnUnhandledException:

System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.

à Xamarin.VisualStudio.Debugger.AD7DebugExceptionEvent..ctor(Thread thread, String description) dans C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\Core\VisualStudio\Debugging\MonoTools.Engine\AD7Events.cs:ligne 433

à Xamarin.VisualStudio.Debugger.ExceptionsAdapter.OnUnhandledException(Object sender, TargetEventArgs args) dans C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\Core\VisualStudio\Debugging\MonoTools.Engine\ExceptionsAdapter.cs:ligne 63

This message appears in a pop-up during the application debug.

This first pop-up is immediately followed by a second one with this error message :

EXCEPTION: System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.

à Xamarin.VisualStudio.Debugger.AD7DebugExceptionEvent..ctor(Thread thread, String description) dans C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\Core\VisualStudio\Debugging\MonoTools.Engine\AD7Events.cs:ligne 433

à Xamarin.VisualStudio.Debugger.ExceptionsAdapter.OnUnhandledException(Object sender, TargetEventArgs args) dans C:\Users\builder\data\lanes\2972\1cc3a999\source\XamarinVS\src\Core\VisualStudio\Debugging\MonoTools.Engine\ExceptionsAdapter.cs:ligne 67

à Mono.Debugging.Client.DebuggerSession.OnTargetEvent(TargetEventArgs args)

à Mono.Debugging.Soft.SoftDebuggerSession.HandleBreakEventSet(Event[] es, Boolean dequeuing)

à Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)

à Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()

It's very hard to find if the problem comes from my app or from the last Xamarin/Visual Studio update.

Does anyone encounter the same problem or does this issue is a well-know problem from Xamarin/Visual Studio ?

Thanks everybody for your help !

Posts

  • patrickdenglerpatrickdengler USMember

    There are so many moving parts here, and I feel your pain.

    Does it provide you an option to view exception detail and dig in more? (InnerException) That's usually how these otherwise seemingly hidden bugs surface (you're seeing essentially a result of another).

    Do you know if it ever even invokes a line of code in your project? For example, if you just use F11 to start the project, does the error pop? If not, try to isolate at which line of code this error is being thrown, then wrap a try/catch just around that one. I find that usually forces the debuggers and compilers to align and provide the right detail.

  • BrendanZagaeskiBrendanZagaeski USForum Administrator, Xamarin Team Xamurai
    edited April 2017

    I will close this forum thread to direct further discussion and updates onto a corresponding public bug report: Bug 39433.

    See also an earlier forum discussion on the same error:


    (As always, I'm also happy to reopen the thread upon request within the next month or two. Just send a quick email to [email protected] with a link to this thread. For follow-up after the next couple of months, if the remaining related open bug reports or forum threads do not cover the desired scenario, please follow the recommendations to file a new bug report or create a new forum thread. Thanks!)

This discussion has been closed.