Xamarin.Forms IOS Breakpoints Not Hit

后端 未结 6 1714
一个人的身影
一个人的身影 2021-01-04 04:05

I recently upgraded to the new Xamarin for Visual Studio, and since then, I can no longer hit breakpoints during IOS debugging. Android works fine, strangely.

I uni

6条回答
  •  耶瑟儿~
    2021-01-04 05:05

    There is a bug in Xamarin.iOS, which will is fixed in Xamarin.iOS 10.12.0.12 (494fcbc), which should be available in beta channel. The problem seems only to occur in a PCL, which is the case if you set a breakpoint in your portable project (Xamarin.Forms code).

    There is a temporary workaround, which worked for me:

    Possible temporary workaround: switch the portable class library project(s) to output "portable" PDB files rather than "full" PDB files

    1. Open the portable class library .csproj file in a text editor. For example, right-click the project in the Solution Explorer and select Unload Project, and then right-click it again and select "Edit ...".

    2. Under the PropertyGroup for the "Debug|AnyCPU" configuration, change the DebugType to: portable

    3. Save the change and reload the project.

    4. Build, deploy, and start debugging the iOS app project again.

    There is an issue on Android if you do the above steps. To be able to hit the breakpoints on Android again, you have to do this:

    Long story short, if you manually delete the "bin" and "obj" folders for each of the projects that you have switched to portable, uninstall the app from the test device, and then clean and rebuild the solution, that should hopefully allow the portable mode to work with Android too. Once you have performed those clean-up steps once, you should in theory not need to perform them again unless you switch the DebugType again.

    Edit

    On Android I still have troubles, so it's not the perfect way.

提交回复
热议问题