"mscorlib.pdb not loaded" yet the mscorlib.dll is NOT missing

Visual Studio-2012

Visual Studio-2012 Problem Overview


I am running my application in VS2012 and I am getting a runtime error; enter image description here

When I look in the "Original Location" I see mscorlib.dll, but not mscorlib.pdb.

Why is this happening and how do I fix it?

Visual Studio-2012 Solutions


Solution 1 - Visual Studio-2012

Goto Tools, Options, Debugging, General, Enable Just My Code

This will prevent the debugger from trying to launch on a Internal .NET Framework Assembly.

Solution 2 - Visual Studio-2012

Goto Tools, Options, Debugging, Symbols and set a cache location. Then hit load in the above and it will fetch the necesary symbols for you and store them in the cache location you provide.

Microsoft's compiler tools create symbols in separate files with a .pdb extension (program database). This allows them to create detached symbols for release binaries. With a symbol server, your IDE can fetch the symbol file matching the specific version of the DLL during debugging. You can configure this system for your own product binaries as well which can be very useful for post-mortem debugging any crashes on end-user machines.

See Microsoft's documentation for more details about using their public symbols.

Solution 3 - Visual Studio-2012

I had this issue when I was using a static variable, whose value is assigned off a static method.

So, whenever I ran the application, this line of code threw exception. If you place a debug point on this (like I did), you will notice the exception being thrown.

Solution 4 - Visual Studio-2012

The best Solution to solve this error is:

1: Open App.config file.

2: Paste this useLegacyV2RuntimeActivationPolicy="true" code in the startup tag.

3: Save it.

Now the error would disappear. Moreover see this Image. I have done this for you.

Solution 5 - Visual Studio-2012

This happened to me for a different reason: I had referenced an old version of NLog (2.0) and needed to reference version 4.0, instead.

Solution 6 - Visual Studio-2012

In a VB console app, in my case it was none of the above.

Just doing a string calculation in the Dim declarations before my subs.

The offending code:

Dim FylPrefix$ = Fyl.Substring(0, Fyl.LastIndexOf("."))

Moving this calculation into the sub it was needed in fixed it! GERONIMO!!

Solution 7 - Visual Studio-2012

In my case the exception began to appear after I changed the "Assembly name" in the "Application" tab of the properties window. If that's the case with you try reverting to the original name and see if the exception disappears. Perhaps the reason for this was that the new name did not match the AssemblyTitle in AssemblyInfo.cs.

Solution 8 - Visual Studio-2012

This can happen when you initialize a variable in your class declarations and that initialization throws an exception:

class Program
{
    static OracleConnection ora = getOracleConnection(); 
    
}
static void main(string[] args) 
{
    ora.Open();
}
static OracleConnection getOracleConnection()
{
   OracleConnection orax = new OracleConnection(description=(host=myHost)
    (port=1521)(protocol=tcp))(connect_data=(sid=mySid)));user id=user;password=pw;
}

If an exception is thrown by getOracleConnection() you can get this error. Move your assignment (but not necessarily your declaration) inside of main (where it belongs anyway), and you will get the actual exception that is causing the error instead of the mscorlib error.

Solution 9 - Visual Studio-2012

if you have this type of project runtime error in visualstudio Answer:Cntr+Alt+E open Exception window Uncheck All chechboxes Must and shoud its working written by B sriram Mca Giet College rajahmundry, east godavary ,2014 batch

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionarame3333View Question on Stackoverflow
Solution 1 - Visual Studio-2012WallbasherView Answer on Stackoverflow
Solution 2 - Visual Studio-2012patthoytsView Answer on Stackoverflow
Solution 3 - Visual Studio-2012Nabil ShaikView Answer on Stackoverflow
Solution 4 - Visual Studio-2012Muhammad AbbasView Answer on Stackoverflow
Solution 5 - Visual Studio-2012DavidView Answer on Stackoverflow
Solution 6 - Visual Studio-2012Runner66View Answer on Stackoverflow
Solution 7 - Visual Studio-2012RoySebergView Answer on Stackoverflow
Solution 8 - Visual Studio-2012AinsworthView Answer on Stackoverflow
Solution 9 - Visual Studio-2012BsriramView Answer on Stackoverflow