0

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 window

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....

Community
  • 1
  • 1
blackwolfsa
  • 327
  • 3
  • 14
  • are you certain that your dll project is build for the last time? – Mehdi Khademloo Nov 26 '14 at 08:13
  • Is this a Silverlight project by any chance? – slugster Nov 26 '14 at 08:16
  • Can you show the properties for the reference between your startup project `CustomCode` and `CustomCodeDLL`? Is `CustomCode` copying the reference through every time? – slugster Nov 26 '14 at 08:21
  • slugster, what do you mean the referance between the startup project and the dll? Do you want to see the main code? – blackwolfsa Nov 26 '14 at 08:33
  • Expand the references node of CustomCode in the solution explorer, right click on the CuctomCodeDLL reference, select Properties - what does it say? – slugster Nov 26 '14 at 12:32
  • Just wanted to comment quick. i was having this problem and found out it was because the c++ dll was compiling for x64 but the c# was set to any cpu (it was defaulting to x32) so changed it to x64 and can now debug the c++ code – iedoc Nov 18 '15 at 18:37

3 Answers3

0

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.
t3chb0t
  • 16,340
  • 13
  • 78
  • 118
0

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"

Mehdi Khademloo
  • 2,754
  • 2
  • 20
  • 40
  • I have manually build it each time, does nothing. I have even tried to add a public variable to the static class. Build it and i can see it immediately in the main exe program code. – blackwolfsa Nov 26 '14 at 08:31
  • have you tried to close the CS file and re-open it?? – Mehdi Khademloo Nov 26 '14 at 08:32
  • Not as per say. But if I am not debugging and I press f12 on the code, it just straight to my code which I want to debug. If I am debugging and I press f12 over the code, it jumps to that locked metadata view of only the function headings – blackwolfsa Nov 26 '14 at 08:42
  • Scratch that, it only jumps straight to the metadata view, if I am debugging or not. It did not do this yesterday. Yesterday it was as above – blackwolfsa Nov 26 '14 at 08:44
0

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.

blackwolfsa
  • 327
  • 3
  • 14