We help IT Professionals succeed at work.

dll development in visual studio 2013

dhenderson12
dhenderson12 asked
on
62 Views
Last Modified: 2015-07-01
I am developing a com dll in vs2013.  at present it is building as a debug configuration.  I have a windows forms app to use in developing the dll, but can't seem to use the debugger to stingle step through the function calls in the dll.  I have added the dll project to the windows project, added a reference to the dll (in the \x86\debug output folder), but still can't step into the code.

any help appreciated!
Comment
Watch Question

CERTIFIED EXPERT

Commented:
Have you tried just using a normal Project Reference as opposed to referencing the output in the Debug output folder? Am assuming your Class Library project AND the Windows Forms projects are both in the same solution? ALSO... not that when you run the Windows Forms DLL, it is probably copying the DLL into it's own \bin folder.

Author

Commented:
ok, I removed the reference to the dll and added it as a project reference;  both projects are in the same solution.  I am still unable to step into the dll methods from the windows form.  does it matter that the the dll is com visible?
CERTIFIED EXPERT

Commented:
It doesn't matter that the code is com visible. When you access it through Windows Forms, it's not using COM. It just accesses your Class Library without using COM.

1.

Are you targeting the same .NET framework version? Make sure you are targeting the same .NET version.

2.

Instead of using the typical F5 (or Start) button to debug things, rather start the *.exe for the test WinForms application that loads your DLL and then attach to it from Visual Studio (Debug -> Attach to Process...)
CERTIFIED EXPERT

Commented:
Do you get any error messages in the Output window?
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2015

Commented:
Do you have .pdb files for the referenced assembly in your "bin" folder? These files are required by VS in order to debug your code.

Author

Commented:
MLandaT - I don't understand your suggestion.  do I leave both projects in the same solution?  the dll is not a running process, so I'm sure how to attach to it.

for all - yes, the .pdb file is in the bin\debug folder.
CERTIFIED EXPERT

Commented:
You leave them in the same solution. You do not attach to the DLL, but you run the EXE (winforms project ... compile, navitage to the bin folder, double click the EXE there) and attach to that EXE.

Author

Commented:
ok, I put a break point in the dll code and attach to the exe: but the breakpoint isn't hit in the dll ... ?

Author

Commented:
btw, I also pointed the output folder of the dll to the output folder of the exe.  I also set the exe to be the start up program for the dll in the dll project properties.
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2015

Commented:
Try a Clean and Rebuild. If that doesn't work, then examine your breakpoints while the application is running. Are they solid or hollowed out? If hollowed out, what is the message you see if you mouse over the breakpoint (dot)?
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
the breakpoint in the dll says it won't be hit because no symbols have been loaded.

Author

Commented:
the .dll, .pdb, and .tlb files are all in the same folder as the .exe that is calling it.
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2015

Commented:
Assuming you've already added the project reference as suggested above, try a Rebuild (not Build) of each individual project separately. Then re-run the application. Do you observe the same behavior?

Author

Commented:
same thing.  I did a rebuild of each project.  the breakpoint in the dll code says there are no symbols loaded.
CERTIFIED EXPERT

Commented:
What version of .NET is the Class Library targetting? Make sure you are targetting the same .NET version in both projects. This is set independently for each project.
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2015
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.