Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 for Bug 39345 on
Developer Community if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
Created attachment 15251 [details]
"Just My Code" fails to let the debugger skip exceptions that are thrown and caught entirely within external libraries (when the debugger is set to break on all thrown CLR exceptions)
This problem affects both Visual Studio and Xamarin Studio. I suspect the fix might be slightly different for each IDE, so I will file 2 separate bugs.
This also might be a tricky problem to solve if the soft debugger does not currently provide enough context about the exception to the IDEs to make this possible.
## Regression status: not a regression
> BAD: XamarinVS 184.108.40.2062 (a9dd59b) + Xamarin.iOS 220.127.116.114 (a8da28f) (Cycle 7 Alpha 1 preview)
> BAD: XamarinVS 3.11.1594.0 (a06d6d5) + Xamarin.iOS 18.104.22.168 (1f068b4) (Cycle 5 – Service Release 5)
## Setup steps for Visual Studio 2015
1. Under "Debug -> Windows -> Exception Settings", click the checkbox for "Common Language Runtime Exceptions" until the checkbox displays a check mark. (See the attached screenshot for "Break on all thrown exceptions, VS 2015".)
2. Enable the "Tools -> Options -> Debugging [heading] -> General [sub-heading] -> Enable Just My Code" checkbox. (See the attached screenshot for "Just My Code, VS 2015".)
## Setup steps for Visual Studio 2013
1. Under "Debug -> Exceptions", enable the "Thrown" checkbox for "Common Language Runtime Exceptions". (See the attached screenshot for "Break on all thrown exceptions, VS 2013".)
2. Enable the "Tools -> Options -> Debugging [heading] -> General [sub-heading] -> Enable Just My Code" checkbox. (See the attached screenshot for "Just My Code, VS 2013".)
## Steps to test
1. Unzip the attached test case.
2. If you have cleaned or manually deleted the `bin\Release` folder for the "PortableClassLibrary1" PCL project, build the "PortableClassLibrary1" project in the Release configuration. (The other projects use a direct `.dll` reference to that library as an example of a "not my code" assembly. The Release configuration for the PortableClassLibrary1 project enables compiler optimizations and disables all debugging information .)
3. Debug the "NativePortable1.Console", "NativePortable1.Droid", or "NativePortable1.iOS" project in the "Debug|AnyCPU", "Debug|AnyCPU", or "Debug|iPhoneSimulator" configuration, respectively.
4. A dialog window might appear to warn you that "You are debugging a Release build of PortableClassLibrary1.dll". If you see that dialog you can select "Continue Debugging".
 For additional information see "To distinguish user code from non-user code, Just My Code looks at open projects, symbol (.pdb) files, and program optimizations.", on:
## Expected result (as demonstrated by the console C# application)
The debugger does not break on any exceptions. (In the case of the console C# app, the app simply runs to completion and then closes.)
## Actual result
In all test scenarios other than the console C# application, the debugger breaks on the exception from `Class1.Foo()`.
### Test scenarios that show this "bad" behavior
VS 2013 + NativePortable1.Droid
VS 2013 + NativePortable1.iOS
VS 2015 + NativePortable1.Droid
VS 2015 + NativePortable1.iOS
(Note: in exactly 1 of my trials (out of maybe 20 total) Visual Studio did not break on the exception in the Android sample. I expect this was simply a funny little timing issue or perhaps a result of some stale files that I forgot to clean when switching test environments.)
Created attachment 15253 [details]
Break on all thrown exceptions, VS 2015
Created attachment 15254 [details]
Just My Code, VS 2015
Created attachment 15255 [details]
Break on all thrown exceptions, VS 2013
Created attachment 15256 [details]
Just My Code, VS 2013
Add VS2017 15.2 to the list.
BTW, this is highly annoying.
This is blocked on this bug: https://bugzilla.xamarin.com/show_bug.cgi?id=39371. We need that to be fixed before we can fix this. Pushing internally.