I have a solution with three projects in it. One is the business layer which has an output set to class library. The second is a UI layer which is currently setup as a console application and the third is a unit test project.
I have referenced the business layer application in my UI and set the startup object to UI.Program but when I try to run the application I get the following error:
A project with an 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.
I cant find the source of this error, and I've tried what others have done to fix this problem with no luck. Any suggestions?
Right click the project you would like as your 'startup project' and select 'Set as start up project'. That should probably solve your problem.
It seems that you're setting the startup object but you have to select a project in your solution as the start up project, this has to be a console application or windows form application.
For more information see the screenshot at this link:
http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioSetAsStartupProject.png