Breakpoints not loaded in UWP without .Net Native Toolchain enabled

JamesEshJamesEsh USMember ✭✭
edited February 2018 in Xamarin.Forms

When creating a new Net Standard Xamarin Cross-Platform App then putting a breakpoint in shared code and starting the UWP app the debugger does not break on the breakpoint and VS says the breakpoint is not loaded. If you go to [UWP app] > bin > Debug > x86 > AppX there are no pdb files, which is why I assume the breakpoints don't get loaded.

Does anyone have a solution to this? Enabling .Net Native Toolchain fixes the issue, but makes compiling much slower. An issue was posted to the VS developer community, but it doesn't seem to be getting much attention...

developercommunity.visualstudio.com/content/problem/124393/uwp-breakpoints-ignored-when-net-native-toolchain.html

Best Answer

  • JamesEshJamesEsh US ✭✭
    Accepted Answer

    The workaround for this is to add the ...\bin\Debug\x86\ folder to the symbols manually (Tools > Options > Debugging > Symbols)

Answers

  • JamesEshJamesEsh USMember ✭✭

    developercommunity.visualstudio.com/content/problem/124393/uwp-breakpoints-ignored-when-net-native-toolchain.html

  • JamesEshJamesEsh USMember ✭✭

    developercommunity.visualstudio.com/content/problem/124393/uwp-breakpoints-ignored-when-net-native-toolchain.html

  • JamesEshJamesEsh USMember ✭✭
    Accepted Answer

    The workaround for this is to add the ...\bin\Debug\x86\ folder to the symbols manually (Tools > Options > Debugging > Symbols)

  • BohirBohir TJMember ✭✭

    Thanks Jamesboy that worked for me. ;)

  • DavidGerding.4136DavidGerding.4136 USMember ✭✭

    I'm having what I think is the same problem. The proposed work around doesn't work for me. The UWP project of a Xamarin Forms solution will only break in the UWP project, but not in the Xamarin Forms base project code. Breakpoints show as unavailable. Any help appreciated.

  • ClayBrinleeClayBrinlee USMember ✭✭

    @DavidGerding.4136 Xaml compilation is causing the problem. I've had this issue for years. Here is the fix: remove all [XamlCompilation(XamlCompilationOptions.Compile)] from your app. Then go to your App.xaml.cs and add this at the top before the namespace declaration (so you still get xaml compilation building for prod):

    #if (DEBUG == false)
    [assembly: XamlCompilation (XamlCompilationOptions.Compile)]
    #endif`
    

    ...or you can surround all your xaml compilation statements I said to remove with the same if statements, either way.

Sign In or Register to comment.