Error: A project with an output type of class Library cannot be started directly

Error: A project with an output type of class Library cannot be started directly

ewcler
Enthusiast Enthusiast
3,730 Views
2 Replies
Message 1 of 3

Error: A project with an output type of class Library cannot be started directly

ewcler
Enthusiast
Enthusiast

When I tried to compile my first add-in created in VB2010 Express, I received the following error:

A project with an output type of class Library cannot be started directly.

I am enough of a NOOB, that the instructions that appear in the message don't make sense to me.  

 

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

 

I am also running on Windows XP 64. 

Any help would be appreciated.

 

 

 

 

Eddie Cler
Paul's Machine & Welding Corp.
Dell Precision T3600- Xeon E5-1620 @ 3.6 GHz 32GB Ram - Nvidia Quadro 4000 Windows 7
0 Likes
Accepted solutions (1)
3,731 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Accepted solution

The message makes sense, it tells you that a .dll file cannot be run. 
There are a couple of ways to run the code in the class library project:

  1. Add a test project that calls the code you want to run. This is by far my preferred approach. See nUnit or Visual studios embedded testrunner (depending of if you have expensive enough version of Visual Studio.
  2. Create a console application that runs the code you want to run in the debugger.

/Johan

Message 3 of 3

fsdolphin
Collaborator
Collaborator

      The message makes sense, it tells you that a .dll file cannot be run. 
     There are a couple of ways to run the code in the class library project:

  1. Add a test project that calls the code you want to run. This is by far my preferred approach. See nUnit or Visual studios embedded testrunner (depending of if you have expensive enough version of Visual Studio.
  2. Create a console application that runs the code you want to run in the debugger.

I'm having the same issue when compiling an empty project created with the Autodesk Inventor Addin template for Visual Basic in Visual Studio Express.

 

Can someone be so kind and explain this a little bit more? Sorry but I don't understand how can I reference this from a console application or a test project.

 

I was following the the instructions in the following .pdf docuemt and according to section "Creating an Add-In" the code should compile without creating an additional project. 

PDF Doc

http://modthemachine.typepad.com/files/VBAtoAddIn.pdf

 

FYI - Inventor 2013 / Visual Studio Express 2013

 

Thanks a lot

0 Likes