"Cannot find or open the PDB file" from Visual Studio 2013 RC
Asked Answered
A

2

12

First time user of C#, but I have experience with Java.

I wrote a Hello World program to initiate myself, but I have been getting this cannot find or open the PDB file error when compiling.

'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'C:\Windows\assembly\GAC_64\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'. Cannot find or open the PDB file.
'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll'. Cannot find or open the PDB file.
'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'. Cannot find or open the PDB file.
'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll'. Cannot find or open the PDB file.
'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'. Cannot find or open the PDB file.
'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll'. Cannot find or open the PDB file.
'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\12.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'. 
'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'c:\users\520\documents\visual studio 2013\Projects\ConsoleApplication4\ConsoleApplication4\bin\Debug\ConsoleApplication4.vshost.exe'. Cannot find or open the PDB file.
'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'C:\Windows\assembly\GAC_64\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll'. Cannot find or open the PDB file.
'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll'. Cannot find or open the PDB file.
'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Drawing.Design\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.Design.dll'. Cannot find or open the PDB file.
The thread 0xa14 has exited with code 259 (0x103).
The thread 0x235c has exited with code 259 (0x103).
'ConsoleApplication4.vshost.exe' (CLR v2.0.50727: ConsoleApplication4.vshost.exe): Loaded 'c:\users\520\documents\visual studio 2013\Projects\ConsoleApplication4\ConsoleApplication4\bin\Debug\ConsoleApplication4.exe'. Symbols loaded.
The thread 0x25b8 has exited with code 259 (0x103).
The thread 0x9d0 has exited with code 259 (0x103).
The program '[8756] ConsoleApplication4.vshost.exe' has exited with code 0 (0x0).
The program '[8756] ConsoleApplication4.vshost.exe: Program Trace' has exited with code 0 (0x0).

What could be the issue?

Aun answered 19/11, 2013 at 21:21 Comment(5)
Can you post your code? What is your configuration set to?Soleure
This is entirely normal. Focus on debugging your own code, debugging the .NET framework isn't useful.Melidamelilot
possible duplicate of Error Message : Cannot find or open the PDB fileSeafowl
@HansPassant is there a way to turn it off?Sixfold
Sure, right-click the Output window and untick the notifications you don't want to see.Melidamelilot
I
10

What matters the most is fine, the symbols for your own code could be loaded: ...ConsoleApplication4.exe'. Symbols loaded.

The rest of the missing symbols are for the .NET system's assemblies (dlls). They are not needed all the time, you can debug your code without them, but if you do advanced things like messaging, majority of your stack won't be able to be unrolled (or sometimes it's called "symbolicated").

I prefer to have as much system pdbs (debug symbol files) as possible. It's very easy to setup with VS 2012, I assume that VS 2013 is just as easy or even better. http://msdn.microsoft.com/en-us/library/b8ttk8zy%28v=vs.90%29.aspx

Note, that after setting up symbol downloading you'll experience major delay the first time you'll debug your code. That's when the symbol downloading happens. Once that's done starting debug will be fast again (because new symbols are only needed if the .NET system gets some updates which affects your assemblies too).

I also install "Debugging Tools for Windows xy" and "Windows xy SDK" too (where xy=7, 8, 8.1, 10 depending on which Windows you are using, plus the architecture matters too: X64 or 32), even if I only debug managed (that's the term for programs written in .NET garbage collected and handled languages) code. http://msdn.microsoft.com/en-us/library/windows/hardware/ff551063%28v=vs.85%29.aspx

One assembly you may not get symbol for is the ConsoleApplication4.vshost.exe. That's a stub what Visual Studio debugger uses to start your program. You can see it in the Process Explorer (Sysinternals Tools suite), sometimes more instances are lingering around.

Iveson answered 20/11, 2013 at 16:27 Comment(2)
I just enabled 'microsoft symbol servers' in the Options dialog box -> Debugging node -> Symbols. I started the debugging session, then the symbol file was automatically loadedSignore
@cerebrosys Yes, these days enabling the feature is easy (easier than it was in VS 2012 or 2010 or earlier). But after you download symbols, you may not have symbols for all of the entries in the call stack. Missing one symbol may prevent unrolling some portion of the stack. And you surely won't get symbol for your ...vshost.exe. Also you may cross managed/unmanaged boundaries multiple times within a call stacj.Iveson
B
0

When I have received this message, it was because when opening a the project, I clicked on "C# Console App .NET CORE" instead of "C# .Net Framework". You can copy the program, open a new project using .Net Framework, and paste in the copied program. If you have your program debugged, I should work perfect. It has for me.

Bamby answered 31/7, 2020 at 21:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.