0
A project with an output type of class library cannot be started directly

I'm setting my solution to Release mode to test some functionality and this is the error I get. This is the settings I have and these work fine in Debug mode.

  • Output Type: Class Library
  • Startup Object: (Not set)

The error occurs after I set my solution to Release mode (clean and build performed). Here's what I have done so far.

  • Changed the Output Type to Windows Application and Console Application
  • Set the Startup Object to Program.cs
  • Deleted .suo file
jmc
  • 1,649
  • 6
  • 26
  • 47
  • 1
    Do you have multiple projects in your solution? Seems like you have. And in Debug mode you have different start project rather than the one, which is of class library type. – Deilan Mar 04 '15 at 06:41
  • Yes I have. I figured out that when I switch to release mode, it deletes the entry under Properties>Debug>Start External Program which points to another project. I have this working now, thanks. – jmc Mar 04 '15 at 07:19
  • 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:09

1 Answers1

0

I figured out that when I switch to release mode, it deletes the entry under:

  • Properties > Debug > Start External Program

which points to another project. I have this working now.

-- @jmc

kenorb
  • 155,785
  • 88
  • 678
  • 743