Click here to Skip to main content
14,735,239 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am trying to run the example solution described in the Code Project example and I get this error "A project with an Output type of class library cannot be started directly.

What I have tried:

I looked thru the description looking for a discussion or direction on what to do.
Updated 3-Mar-20 3:01am
BillWoodruff 5-Sep-19 19:06pm
"I am trying to run the example solution described in the Code Project example" which article ? We can't read your mind.

Open the Solution Explorer pane in Visual Studio, find the EXE project branch and right click it. In the drop down list that appears is "Set as Startup Project". Click that, and the EXE will run when you debug.

But normally, if you got code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.
leorhansen 5-Sep-19 14:40pm
I tried that. Should I change it from "Single startup project" to " multiple …"
There are 4 projects in the listed, how do I know which one to set as "startup". I tried them all individually. Thanks for the help.
leorhansen 5-Sep-19 15:27pm
I tried both approaches, "bold Single" and multiple. I get the same error either way. I am using VS2019, is that a problem?

I just tried VS2017 and after I got the original error the following error showed up: "HTTP Error 403.14 - Forbidden
The Web server is configured to not list the contents of this directory."

Any ideas?
RickZeeland 5-Sep-19 16:17pm
Can you tell us which CodeProject example you are using ?
Which article are you talking about?

CP doesn't write the articles. They are written by people who volunteer their time. If you've got a problem with an article, there's a forum at the bottom of the article to ask questions about it.

If you created the projects yourself, it's entirely possible you created one of the projects with the wrong project template.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900