I've download sample code with C#. but when I run I get this error message:
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.
Please give me a solution.
Solution. Right click on the Solution Explorer of your project in the right top corner of the IDE and the select the Properties option located in the dropdown menu. Now from the Solution Property Pages dialog that appears, select the StartUp Project list option.
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.
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.
The currently selected startup project is a Class Library.
You need an entry point for your application. Does your solution contain multiple projects?
Are you sure you want to 'run' the Class Library?
Possibly you've downloaded a Class Library solution only. In that case there might be unit tests that you can 'debug' to step-trough the code.
Update In response to your comment, these are possibilities to run the class library:
If you have a project with an executable right-click this and select "Set as start project" - if not you have to write one to debug your code (or use Unit-Tests).
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