Breakpoints Not Working

FrederikTheisenFrederikTheisen DKMember ✭✭

Hello.

Ever since the update which suggested that I migrate from XS to VSforMac, breakpoints have not been working for me, I use Xamarin.Mac Full framework. I also had to add some CscTool property (https://forums.xamarin.com/discussion/95231/compile-error-after-updating-to-15-2).

The breakpoints turn hollow when I start debugging.
System.Diagnostics.Debugger.Break(); works, but I can't see the values of variables, so it's more or less useless.

Breakspoints do work if I create a new project.
I'm currently using the alpha channel.

Best Answer

Answers

  • ChrisHamonsChrisHamons USXamarin Team Xamurai

    That sounds like a bug. Please file a bug and attach a sample showing the issue, and we can look into what's causing the trouble.

  • FrederikTheisenFrederikTheisen DKMember ✭✭

    As far as I can see, the Csc tool which I linked to in my post, results in breakpoints not working.
    Creating a new project and adding

    mcs.exe

    to the .csproj file is enough to reproduce on my system.

    There could be other reasons, but I can't remove the csc tool ref from my project.

  • dpedrinhadpedrinha DEMember ✭✭✭

    @ChrisHamons said:
    Doing some research, I came across this which may be helpful

    https://bugzilla.xamarin.com/show_bug.cgi?id=56246#c11

    For users attempting the workaround on Mac, it is also recommended to disable "Visual Studio > Preferences > Build with MSBuild instead of xbuild" and then close and restart Visual Studio for Mac.

    (The new msbuild default in Visual Studio for Mac does not copy the .mdb files for user assemblies into the "bin" folder or application package as expected, so the debugger will not be able to hit breakpoints or break at the expected source locations for exceptions. Switching to xbuild allows the build process to copy the .mdb files as expected.)

    Where is this option "Build with MSBuild instead of xbuild" ?

  • ChrisHamonsChrisHamons USXamarin Team Xamurai

    Visual Studio Menu Item -> Preferences Menu Item -> Build Tab -> Build with MSBuild instead of xbuild

    Image here: https://www.dropbox.com/s/zp52xfd2xc1lu7t/msbuild.png?dl=0

  • dpedrinhadpedrinha DEMember ✭✭✭

    Thanks.

    My problem was with the linker. For some reason every time I change the Active Solution Configuration it changes my linker behavior.

  • starl1nstarl1n DOUniversity ✭✭

    Know is old, but just want to let people know that the issue is still happening (with current version of VSMac, had to build with xbuild instead of msbuild as @chrishamons says to recover breakpoints

    Was going crazy putting Debug.WriteLine everywhere lol

  • ChrisHamonsChrisHamons USXamarin Team Xamurai

    @starl1n - Consider isolating your issue sufficiently and reporting an issue https://github.com/xamarin/xamarin-macios/issues/new

    We would love to figure out what's going on, but without a sample it'll be very difficult.

Sign In or Register to comment.