Forum Xamarin.Forms

how to debug forms errors - custom control/renderers

GeorgeCookGeorgeCook PEUniversity ✭✭✭

I used the exact same recipe I used for previous custom controls but when I use them in xaml the app crashes with:
"Exception has been thrown by the target of an invocation." nested down in System.Reflection.MonoCMethod.InternalInvoke.

It's definitely caused by using my custom control - however, I can't work out how to debug what is wrong.

What do you guys do in this situation?


  • PaulDistonPaulDiston USUniversity ✭✭✭✭
    edited March 2015


    If you are using Visual Studio, I tend to turn on "Common Language Runtime Exceptions - Thrown" in Debug > Exceptions...

    This sometimes provided more information about the code causing the exception.

    Hope this helps.

    Paul Diston

  • GeorgeCookGeorgeCook PEUniversity ✭✭✭

    thanks - I'm on xamarin studio on mac; but perhaps your advice will help other windows users.

  • adamkempadamkemp USInsider, Developer Group Leader mod

    In Xamarin Studio you can add a new "exception catchpoint" to do the same thing. Also, if you look at the exception you already have there is probably an InnerException (a property of Exception) with the original exception that was thrown, along with the original callstack.

Sign In or Register to comment.