Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: A project with an out put type of class library

I am trying to figure out .net and got this code that when I try to run from VS 2008 it gives me this 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 to the library project. Set the executable project as the startup project

I am learning C# so have no idea what to do here

like image 832
user400749 Avatar asked Feb 23 '11 18:02

user400749


People also ask

How do you change the output type of the project properties to the Class Library?

In the newly added project, you can implement logic to test your Class Library. Output type of the project you can find and change by the following steps: Right click on project in Solution Explorer -> Properties. In opened tab with properties select Application and there will be ComboBox marked with Output Type label.

How do I change the output type in Visual Studio?

Right Click the project in the Solution Explorer. Click Properties. Select Application in the Properties Window. Click on the Output Type Combobox and change that to Class Library.

How do I run a Class Library project in Visual Studio?

Right-click on the solution in Solution Explorer and select Add > New Project. On the Add a new project page, enter library in the search box. Choose C# or Visual Basic from the Language list, and then choose All platforms from the Platform list. Choose the Class Library template, and then choose Next.

Can Class Library project run in C#?

This tutorial shows, how to build a simple Class Library . DLL in the C# Programming Language. The Class Library . DLL contains program code, data, and resources that can be can used by other programs and are easily implemented into other Visual Studio projects.


1 Answers

You cannot run a library. You could only run an executable or a web site. So right click on the corresponding project and Set as StartUp Project. Then you can run it:

enter image description here

like image 50
Darin Dimitrov Avatar answered Oct 20 '22 19:10

Darin Dimitrov