We help IT Professionals succeed at work.

How to debug a Visual Studio class library being used by an Office VSTO addin?

Hi all,

I do not own a version of Visual Studio that is allowed to make Office addins.  Thus I plan to create and build a simple Office addin on another computer which uses a class library.   For example if this was for outlook my addin would pass a reference to a mailitem to my class library.  Then I plan to come back to my own computer, install the addin and then develop the class library further.

Is this possible?
How do I reference this kind of class library in the Addin project so that when installed on my computer it still finds the class library?
How can I do this so I can debug the class library?

From what I understand MS has visual studio set up so that the express version cannot even open an Office addin project.

Thank you for your help.
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
Debug in what way? Catch errors? If you copy the pdb file as well with DLL then you would be able to catch errors.
CERTIFIED EXPERT

Author

Commented:
On my wish list would be to set a break point in the class library project and step through it.  From what i have seen or tested I dont think this is possible.
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014

Commented:
I don't think that's possible because you need to open the project to do that. Try opening the class file itself and see if you can set the breakpoint.
CERTIFIED EXPERT

Author

Commented:
yes I think you are right but just to be sure what you mean by
because you need to open the project to do that
you mean that two projects are open in the one VS.

So my only option is to load the .dll for the Office addin dynamically at startup and test it.  If it breaks open the project for the .dll and fix the error then build it and then run the office addin again.
CERTIFIED EXPERT
Most Valuable Expert 2012
Top Expert 2014
Commented:
Yes open both the projects within same solution. Yes.
CERTIFIED EXPERT

Author

Commented:
Thank you.

Explore More ContentExplore courses, solutions, and other research materials related to this topic.