0

I am working with Add-ins for the past 10 months. I have not faced problem like this before. When I try to debug my Addin Solution in Visual Studio 2008, I get the following error. Could anyone please help?

A project with Output Type of Class Library cannot be started directly.

In order to debug this project, add an executable project to this solution which references the library project. Set the executable project as the startup project.

Uma Shankar Subramani
  • 1,925
  • 2
  • 12
  • 12
  • What do u mean by addin kind? – Uma Shankar Subramani Jan 02 '12 at 06:25
  • The error you get is the standard error if you hit F5 in VS with a library project set as the default startup project. What steps are you taking that reproduces this error? – Sneal Jan 02 '12 at 06:30
  • Yes. You are right. But my solution has only one Addin project and nothing else. I dont have any library project. Why do I get this error? I just press F5 for debugging. – Uma Shankar Subramani Jan 02 '12 at 07:17
  • Possible duplicate of ["A project with an Output type of Class Library cannot be started directly"](https://stackoverflow.com/questions/3363106/a-project-with-an-output-type-of-class-library-cannot-be-started-directly) – kenorb Sep 18 '18 at 16:14

1 Answers1

1

The error makes sense, you need a hosting process for you addin, e.g. Visual Studio. I usually follow this workflow when debugging my VS addins:

  1. Build your addin library in VisualStudio instance A.
  2. Start VisualStudio instance B.
  3. Load the Addin in VS instance B
  4. In VS instance A, go to Debug | Attach to Process. Select the VS instance B process and attach your debugger.

Once you've done this you can set breakpoints etc just like any other process.

Sneal
  • 2,546
  • 20
  • 22
  • I am sorry. I know how to debug an addin project and set breakpoints. I am working with Visual Studio Addin for the past 1 year. But I face this kind of problem for the first time. I get that strange error message. – Uma Shankar Subramani Jan 02 '12 at 06:04