14

I use VS2017 and I get the following when I hit F5

enter image description here

It happens for certain projects only, even if I disabled the Symbols support under VS options. Although in the past, for the same projects it used not to throw even with Symbol support enabled.

So, since I assumed this must be some kind of cached VS setting project specific, I deleted bin, obj, .vs , SymbolSource folders but the same.

If I enable Just My Code it does not throw, however this is not what I want since I cannot debug assemblies which I already have the symbols.

As far as I know even if Symbols Support is enabled it shouldn't throw if there isn't a related Symbol Server declared in VS Options.

This behavior is not specific only to System.dll but happens even if I attach to external processes which I do not have symbols, meaning that filtering with the Load Only Specified Module VS option again is not what I am looking for.

So, does anybody have an idea on how to avoid such annoying exceptions while allowing to utilize Symbol Support for other assemblies which I have configured.

Apostolis Bekiaris
  • 2,145
  • 2
  • 18
  • 21
  • I want to break but only if I have symbols as it used to break in the past. I try to understand why now it breaks on assemblies that I do not have symbols – Apostolis Bekiaris Sep 13 '17 at 16:38

4 Answers4

11

It means that you want to step in to the .net Framework source code:

http://referencesource.microsoft.com/setup.html

http://referencesource.microsoft.com/indexedpdbs.txt

Actually we also reported this issue to product team for VS 2017 before:

Stepping into .NET Source Still Doesn't Work

If you really want to avoid it, I suggest you disable settings like "Enable .NET framework source stepping" under TOOLS->Options->Debugging.

To debug .NET framework source code,we need to:

Disable just my code

Disable step over properties and operators

Disable require source files to exactly match the original version

Enable .NET framework source stepping

Enable source server support

So just use the contrary settings as above options, debug it again.

In addition, please enable the symbols server under TOOLS->Options->Debugging->Symbols Server, and enable the exception settings window, view the detailed exception messages, maybe you have to resolve the Exception firstly or get any helpful information from it.

Jack Zhai
  • 6,230
  • 1
  • 12
  • 20
  • 1
    >If you really want to avoid it, I suggest you disable settings like "Enable .NET framework source stepping" under TOOLS->Options->Debugging. It is disabled already but still throowing – Apostolis Bekiaris Sep 14 '17 at 16:53
  • @Apostolis Bekiaris, just add other suggestions for this issue, if possible, you could view it in above answer. If still no help, could you share a simple sample using one drive? So we could debug it in our side using the same sample as yours. – Jack Zhai Sep 19 '17 at 06:59
2

None of the above worked for me because I was using external DLL which didn't have the PDB file with it. I found that when I removed all the breakpoints.

Go to Debug menu > Windows > Exception Settings (or press ctrl + alt + E)

Now check Common Language Runtime Exceptions or click Restore default (Refer screenshot):

enter image description here

So when it throws exception and you don't see it, it want to use the PDB file to store the stack trace but it didn't find it.

RBT
  • 24,161
  • 21
  • 159
  • 240
Abdullah Tahan
  • 1,963
  • 17
  • 28
2

I had to check Enable native code debugging under Debug tab in project properties window (Refer screenshot). After that, press Ctrl + Shift + S to save the property window changes.

Thus after saving project properties, issues goes away whenever we start a new debugging session.

enter image description here

RBT
  • 24,161
  • 21
  • 159
  • 240
1

Try to uncheck the debug hosting service.

This worked for me!

RBT
  • 24,161
  • 21
  • 159
  • 240