I downloaded a C# project and I wish to debug the project to see how an algorithm implementation works.
The project has come in a Folder, inside this folder there are -
.sln
file and .csproj
file.I installed Visual Studio and opened the .sln
file present in the main folder. I built the project successfully, but when I try to debug the project I get this 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.
The strange part is that I don't see a main function anywhere.
What should I do to get round this hiccup?
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.
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.
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.
The project you have downloaded compiles into a dll assembly and provide a set of classes with implemented functionality.
You should add to your solution a new project with Output Type of either Console Application or Windows Application (VS Add Project wizard will offer you different templates of Projects).
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.
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