Breakpoints not getting hit in Xamarin Studio

后端 未结 13 776
暗喜
暗喜 2020-12-31 02:56

My breakpoints aren\'t getting hit in Xamarin Studio. I\'m not sure if this has to do with my code, or not, but I feel as though it doesn\'t because I\'ve tried over and ove

相关标签:
13条回答
  • 2020-12-31 03:21

    If once the project launches on the device VS reverts to the standard editing mode (no debug options enabled in the menu) i.e. the debugger is not attached; check Project Properties > Android Options > Enable developer instrumentation is checked. For me the setting was disabled (most likely checked into source control after a release).

    0 讨论(0)
  • 2020-12-31 03:26

    Use "Visual Studio for Mac" (Preview at the moment but works) instead of "Xamarin Studio". This fixed the problem for me. Breakpoints are working even in my PCL projects! Another thing... I had to change "project.json" (JSON format) to "packages.config" (XML format) when changing from "Xamarin Studio" to "Visual Studio for Mac".

    0 讨论(0)
  • 2020-12-31 03:27

    I encountered this yesterday, using VS 2013 and Xamarin plugin. "All of a sudden" breakpoints in a PCL project were not active, even though breakpoints in an Android project still were. Everything had been working perfectly for weeks, and I had applied no updates. Looking at the VS Debug | Windows | Modules view, I could see that symbols were not loaded for the PCL assembly, and nothing I tried would force them to load, even though they were present in the folder with the running assemblies.

    Then I remembered that the last thing I had done the prior day was not related to code, but was a bit of refactoring of csproj files to support a parameterized Jenkins build. I had placed an OutputPath definition in the first "shared" PropertyGroup, and removed it from all of the Configuration/Platform-specific PropertyGroups, e.g.:

    <OutputPath>bin\$(Configuration)\</OutputPath>
    

    I deleted this "common" OutputPath and put it back into each specific PropertyGroup (offending my DRY sensibilities, mind you), and things started working again.

    This is probably not going to bite very many people, but it wasted a couple of my hours, so hopefully it spares someone else. The Xamarin build probably does some of its MSBuild/xbuild spelunking with strong expectations, so if you've modified your csproj files for a build process, this might be a possible culprit.

    0 讨论(0)
  • 2020-12-31 03:29
    1. Make sure you have your build configuration set to Debug.
    2. Make sure your project's build settings are set to allow emitting DEBUG symbols for your Debug configuration.
    3. Clean and Rebuild your solution/project.
    4. Close and restart Xamarin Studio.
    5. Reboot your computer.

    Sometimes the build configurations for your solution can get complicated, and it's easy to miss something when building a complex build configuration. Make sure everything is setup properly in there.

    0 讨论(0)
  • 2020-12-31 03:31

    For me "(" and ")" symbols were also causing the trouble, I was searching for weeks for this problem. Remove the "(" and ")" in the full path, do a clean build and de breakpoints are hit again.

    0 讨论(0)
  • 2020-12-31 03:33

    I add this answer because this is the only one that worked for me, in Project Properties > Build I wrongly checked Optimize Code. Unchecking this box solved the issue.

    0 讨论(0)
提交回复
热议问题