简体   繁体   中英

The breakpoint will not currently be hit. No symbols have been loaded for this document. when debussing dll

I get the above mentioned error when trying to add a breakpoint in a dll. I have tried all off the options mentioned here: Link

Background:

  1. I am using vs2013 community edition
  2. The class in the dll is static
  3. dll project is included in my solution I have tried to uncheck "enable just my code"
  4. The module windows reports that the symbols has been loaded.
  5. The dll's pdb file is located in the bin/debug folder where the exe is
  6. I have also tried to check "enable native code debugging"

When I enable "native code debugging" the modules window shows its trying to load the dll twice, first time it succeeds and the second time it fails. I have attached a screen shot of this.

Visual Studio视窗

Is there anything I can try to fix this issue?

The following is a quick description of the projects in the solution.

  1. CustomAppInitioator - standalone app
  2. CustomCode - Test application for dll, I modify the program.cs to only start a form for each dll
  3. CustomCodeDLL - DLL project contain separate classes, eachsuing the namespace customcode.something, each class has its own .cs file
  4. CustomConnectorDLL - dll project for database
  5. CustomEmailDLL - DLL project for emails
  6. CustomIconsDLL - Empty dll project containing an public resource file for icons

Item 2 is the startup project, and I only include on the current test form item 3's class. So 1, 4-6 is not applicable here, I think....

I looks like the dll is not up-to-date. Here are the steps how I always try to resolve it:

  • rebuild your solution and check the ddl created date in the output folder (usually 'bin') if its 'now'
  • if not now then you need to check the paths
  • you can also check if all your projects are set to 'Build' during the bild
  • check whether you reference the rigt dll/project in the Properties window.

I think your dll project does not Build for the last time, you can Build manually this, or set this setting (for visual studio 2012-2013)

Tools -> Option -> Project And Solution -> Build And Run -> Then uncheck the "only build startup projects and dependencies on run"

I found the problem. It was with the merging of dlls. Some of the class require their own dll's I merge all of this into one dll. If I remove this, I can debug in my dll.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM