VS 2008 breakpoint will not currently be hit. No symbols have been loaded for this document

22,793

Solution 1

This may be an old question, but I wanted to answer it after I found a solution for this very problem because it was one of the most complete questions asked in regards to this topic.

Intro

My project is an ASP.NET application, but the base problem will happen on WinForms as well. The problem arises when a DLL is missing from the assemblies output. However, this same exception occurs if the DLL you are referencing then references another DLL that is not in the assemblies. Due to the way the operating system loads DLLs, the referenced DLL must be in the environment path, and not in your output assemblies.

Project A references DLL D. DLL D references DLL X. DLL D may be in your output assemblies. DLL X must be in your environment path.

The core cause to this problem is in the way the operating system loads native DLL's at >runtime. Native DLL's are loaded using the following logic which does not include the >Temporary ASP.net Files nor the applications /bin folder. This problem will also occur in >any .Net application if the Native DLL is not included in the /bin folder with the .EXE >file or if the DLL is not in the Path Environment Variable.

Personal Solution

I was using a DLL called DivaAPIWrapper.dll (Managed DLL for C#). I knew, however, that DivaAPIWrapper.dll needed DivaAPI.dll (Unmanaged C++) to operate. I placed DivaAPI.dll in all my output paths but I kept receiving this error. Only after I placed DivaAPI.dll in my environment path (C:\windows\Microsoft.Net\Framework\v2.0.50727) did it work. Please note: your path may be different if you're using a newer version of the .NET framework!

Complete Solution by Jerry Orman

See Link Here: http://blogs.msdn.com/b/jorman/archive/2007/08/31/loading-c-assemblies-in-asp-net.aspx

Solution 2

I also faced same problem and found many solution from internet but solution works for me is listed below:

Its due to my application made in framework version 4.0 and i was trying to attach process with version below v2.0 so make sure your framework version with Managed code version as its shown below.

enter image description here

Solution 3

This happened to me recently when attaching to a running process. The issue was that the debugging options were set to

Attach to: Native code

For my case, it needed to be:

Attach to: Managed code

Solution 4

One thing I discovered recently and worked pretty nice!!!

The hosting application (the one that is calling your dll to be used) must have this line:

<supportedRuntime version="v4.0"/>

in the "WhateverApplicationItIs.exe.config" file, inside the <configuration> section.

Example: (See "..." as whatever the file has inside it and leave as is)

<configuration>
    ...
    <supportedRuntime version="v2.0.50727"/>
</configuration">

PS: try to match this version with the target framework set in your project properties. I believe 2.0.50727 is a good try for 3.5 Framework, and 4.0 for 4.0 Framework.

For me it just solved two different DLLs I was trying to debug in different applications.

Solution 5

I have the same problem on vs2010, I resolved in flow steps:

  1. Right-click project
  2. Select the properties
  3. Select c/c++ ->General
  4. Set debug information format to program Database(/ZI)
  5. Check linker->debugging Generate Debug info is yes.
Share:
22,793
Michael Eakins
Author by

Michael Eakins

Senior App Developer °React Native °Native Android (Kotlin) °Native iOS Swift (Swift) °Objective-C

Updated on January 21, 2020

Comments