Rahul Tripathi
Rahul Tripathi

Reputation: 172448

F5 or Start Debugging Button is Greyed Out for Winform application?

I know there are many question related to this already on SO but none of them has woked for me till now.

I have a winform application but when I am trying to debug it my Start button is disabled.

Now when I am trying to debug my Start Debugging key is disabled

enter image description here

Things which I have already done are:

1) I have already set my winform application as the Single Start Up project.

2) I have removed the multiple start up project option.

3) I have tried to restart my Visual Studio many times.

4) I have rebuild the application and it is building successfully with no errors.

5) I have build the entire solution and it also build successfuly with no errors.

6) I have checked the sln file and the Format version in it is:

Microsoft Visual Studio Solution File, Format Version 11.00

which I suppose is correct.

Upvotes: 24

Views: 75700

Answers (10)

Graviton
Graviton

Reputation: 83254

On my side, I got this problem even in VS 2022.

I solve the problem by simply restarting the VS 2022. Problem solved.

Upvotes: 1

Reinaldo
Reinaldo

Reputation: 4666

In case you are in Visual Studio for Mac, going into Unity -> Preferences and clicking on "Regenerate Project Files" fixed it for me.

Upvotes: 0

Google Pandit
Google Pandit

Reputation: 1

I changed to Any CPU and it worked for me.

Upvotes: 0

Wolfpack'08
Wolfpack'08

Reputation: 4128

You need to create a new solution. File -> New -> Solution.

That's all.

Upvotes: -2

Spencer Williams
Spencer Williams

Reputation: 851

I have also found that you need to make sure you open up the .sln file in Visual Studio, so that the Solution Explorer displays all the relevant projects. If you open just one of the individual source files, it will not have a context in which to run the program.

Upvotes: 1

Kamaro
Kamaro

Reputation: 1015

Go to the solution Explorer Right click on the solution /Project name and choose set as startup project, it should be enabled.

Go to the solution Explorer Right click on the solution /Project name and choose set as startup project

Upvotes: 41

Franky Rivera
Franky Rivera

Reputation: 553

Go to your "Solution Propery Pages" in StartUp Project make sure that if you have "multiple startup projects" selected that you have at least some of those projects available turned on. If there are non active. You will not be allowed to Debug or start your project.

Upvotes: 1

Hernaldo Gonzalez
Hernaldo Gonzalez

Reputation: 2046

In my case I excluded the project from my solution and close my Solution. When Open again, The Solution change configuration (F4) to Debug|Mixed Platforms (I don't change manually). Then I changed to Debug|Any CPU and works for me!

Upvotes: 3

Chiko
Chiko

Reputation: 81

Just to add more information to user3414693's post it's possible there is a problem in the solution file such as referencing a project that doesn't exist or has had its name changed.

Unloading and reloading the project will recreate this file with the correct information potentially solving the problem.

Upvotes: 4

Rahul Tripathi
Rahul Tripathi

Reputation: 172448

I dont know the reason but this one worked for me. I excluded the project from my solution and then build my solution without it.

And then I again added my project and build my solution and set it as Start Up Application and it has worked for me.

(Truly speaking I really dont understand the reasoning for this!)

Upvotes: 22

Related Questions