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
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.
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.
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.
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.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With