Unable to set startup project in Visual Studio 2022 with a .csproj file

Viewed 46

I am trying to run this example application on my computer but I am having a hard time running it on Visual Studio 2022. I cloned it from Git's website after clicking on open in Visual Studio. I am unable to set the startup project even after scouring through some of the solutions for StackOverflow. I tried editing my launch settings and even adding a startup object to my Projects XML file to no avail.

This is the project in question, https://github.com/halter73/PortExhaustion. Regardless of the solutions, I am unable to set the startup item and end up with 'select a valid startup item.'

2 Answers

Right click on the project, select Set as Start Project:

enter image description here

I cloned the project directly from GitHub and had no issue, just by opening the .csproj it should automatically add the .sln file that you can then save.

After that you should open your solution (.sln) instead. Of course you can do it by hand but it's needless hassle.

I was able to solve this problem. Don't try to clone directly from GitHub, it just doesn't seem to add the startup project properly, and then will not let you do anything with the project. The way I solved it was to clone and unzipped the files to a folder and then made Visual Studio open the .csproj file which fixed all of the issues.

Edit: At least for me on Visual Studio 2022

Related