Visual Studio (for Windows) iOS Cannot set Breakpoint

JoshuaTantonJoshuaTanton USMember ✭✭

I recently started working on a new project for my organization. After opening up the project, connecting it to my mac server and building the iOS project it successfully launches on my device.

However, If I set a breakpoint while the code is running I get a very large error message (screen shot below) "cannot set breakpoint on the specified IL offset". I should also note that if I set the breakpoint before playing the project it will not stop when the code executes.

This error is seriously preventing me from debugging an issue. I've tried unloading and reloading the iOS project. But when I do that it won't deploy, I have to restart the IDE. It will then deploy but then I get the same issue. I've tried deleting my bin and obj folders, but this also has no effect.

The droid project has no issues.

Any suggestions?

Best Answer

  • JoshuaTantonJoshuaTanton US ✭✭
    Accepted Answer

    There were many things I needed to do to get this working.

    Firstly I noticed that Llvm was on, so my first step was to disable this.

    I should note that the Llvm checkbox was both checked and disabled. I had to go into the .iOS.csproj file to manually remove all the MtouchUseLlvm tags.

    After disabling this, I still had the issue. I then did the following;
    delete all break points
    clean the solution
    build the solution
    close VS
    delete .vs file in file explorer
    delete .suo file in file explorer
    clear bin and obj folders
    open VS and project and try

    After reopening the project, I had some other error that was preventing the project from building. Looks like the Linker Behavior was set to None. Changing this to SDKs only allowed me to build.

    After it built the debugger was now working.

Answers

  • JoshuaTantonJoshuaTanton USMember ✭✭
    Accepted Answer

    There were many things I needed to do to get this working.

    Firstly I noticed that Llvm was on, so my first step was to disable this.

    I should note that the Llvm checkbox was both checked and disabled. I had to go into the .iOS.csproj file to manually remove all the MtouchUseLlvm tags.

    After disabling this, I still had the issue. I then did the following;
    delete all break points
    clean the solution
    build the solution
    close VS
    delete .vs file in file explorer
    delete .suo file in file explorer
    clear bin and obj folders
    open VS and project and try

    After reopening the project, I had some other error that was preventing the project from building. Looks like the Linker Behavior was set to None. Changing this to SDKs only allowed me to build.

    After it built the debugger was now working.

  • ColeXColeX Member, Xamarin Team Xamurai

    If problem solved , please mark the answer accepted.

Sign In or Register to comment.