dll development in visual studio 2013

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!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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


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


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...)
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Do you get any error messages in the Output window?
käµfm³d 👽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.
dhenderson12Author 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.
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.
dhenderson12Author 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 ... ?
dhenderson12Author 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.
käµfm³d 👽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)?
I think to keep things simple, just restore the DLLs output folder to it's own default "bin" (as opposed to the output folder of the EXE) and don't set the EXE to be the startup program.

By setting a project reference to the class library project from the winforms test project, the DLL will be copied to the output folder of the EXE when you build.

Make the EXE project the startup project.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dhenderson12Author Commented:
the breakpoint in the dll says it won't be hit because no symbols have been loaded.
dhenderson12Author Commented:
the .dll, .pdb, and .tlb files are all in the same folder as the .exe that is calling it.
käµfm³d 👽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?
dhenderson12Author Commented:
same thing.  I did a rebuild of each project.  the breakpoint in the dll code says there are no symbols loaded.
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.
käµfm³d 👽Commented:
Even though this isn't the final solution, just for fun bring up the Modules window (Debug->Windows->Modules). Scroll down to your assembly; you should see that same error message. Right click the line with your assembly, and select "Load Symbols". If memory serves, you should be prompted for a path. Locate your .pdb file. Otherwise, if the early-onset Alzheimer's has taken hold, and I'm remembering incorrectly, then you will need to set up a symbol location prior to loading from the Modules window. You would do this from within the Options menu item of the Tools menu.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.