Bug 53189 - Debugger doesn't hit breakpoints set in NetStandard library
Summary: Debugger doesn't hit breakpoints set in NetStandard library
Alias: None
Product: Android
Classification: Xamarin
Component: Debugger ()
Version: 7.1 (C9)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-03-09 12:31 UTC by aspyct
Modified: 2017-04-13 19:49 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Solution illustrating the issue (1.68 MB, application/zip)
2017-03-09 12:31 UTC, aspyct

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description aspyct 2017-03-09 12:31:26 UTC
Created attachment 20245 [details]
Solution illustrating the issue

The debugger doesn't hit breakpoints set in NetStandard/csproj libraries.
I am using Visual Studio for Mac preview 4, but I've noticed the same behavior in Visual Studio 2017 on Windows 10.

Steps to reproduce:
- Open the attached project
- Set two breakpoints:
    - one in MainActivity.cs:18 on Class1.DoSomething()
    - one in Class1.cs:10 on the Debug.WriteLine()
- Run the app on Android
- Notice that the "Hello world" is properly printed in the console.

Expected result:
- The debugger should break twice, once on each breakpoint

Actual result:
- The debugger breaks only on the breakpoint set in the Android project, but misses the one in the library.
Comment 1 Gabor Nemeth 2017-03-12 14:18:46 UTC
I'm experiencing this using Visual Studio 2017 on Windows 10, too.
Comment 2 Jon Douglas [MSFT] 2017-04-09 20:38:30 UTC
I believe the support for ppdb is not quite here. Thus the implied <DebugType>portable</DebugType> in a dotnet standard .csproj is not compatible.

You should be able to hit breakpoints in your dotnet standard library by adding the following into your dotnet standard library's .csproj:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">

This will go back to the default debug type of "full" instead of ppdb(portable pdb)

Comment 3 aspyct 2017-04-13 19:48:13 UTC
Indeed, it fixed the issue. Thank you!
Comment 4 Jon Douglas [MSFT] 2017-04-13 19:49:34 UTC
Thus support for ppdb I believe will come with Mono 5. I will be closing this bug out as it is now considered answered.