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

10

24

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.

Falbala answered 14/3, 2014 at 7:33 Comment(2)
Have you tried same solution on some other machine? if that also not working then as u have already tried all other solution looks like you have to share your solution to get us to know what's the problemHalogen
Did you try restarting your system?Bobseine
F
22

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!)

Falbala answered 14/3, 2014 at 8:17 Comment(4)
No, just accept it as an answer and leave it here, so others can benefit of it, when having the same issue.Bobseine
I think it is helpful, so I'm going to give you an upvote, it takes 5 downvotes to kill 1 upvote:)Bobseine
Keep it here, this particular answer recently helped me with this problem.Bisk
Just setting "Set as StartUp Project", without the steps before it, worked right away for me. Thanks for the suggestion!Gesticulation
A
40

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

Apograph answered 19/5, 2015 at 9:14 Comment(1)
using visual studio 2019, there is no such "set as startu project" option, so this doesn't work for meAlbur
F
22

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!)

Falbala answered 14/3, 2014 at 8:17 Comment(4)
No, just accept it as an answer and leave it here, so others can benefit of it, when having the same issue.Bobseine
I think it is helpful, so I'm going to give you an upvote, it takes 5 downvotes to kill 1 upvote:)Bobseine
Keep it here, this particular answer recently helped me with this problem.Bisk
Just setting "Set as StartUp Project", without the steps before it, worked right away for me. Thanks for the suggestion!Gesticulation
L
4

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.

Luisaluise answered 12/6, 2014 at 1:5 Comment(3)
If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context.Trituration
Hi Paulchen, I don't have a new question this post was meant to be provided as an answer to the following posts - https://mcmap.net/q/246781/-f5-or-start-debugging-button-is-greyed-out-for-winform-application and - https://mcmap.net/q/246781/-f5-or-start-debugging-button-is-greyed-out-for-winform-application/3732249 Can either of you please provide why you feel this is not an answer to the question provided? the problem is potentially a broken solution file and it needs to be corrected, removing and readding will rebuild the file solving that issue i can't directly specify what is broken in the file without seeing it, nor would it be possible as the issue has been resolved, this is for other people.Luisaluise
I agree with Chiko here, this seems like a perfectly reasonable attempt to solve the OP's problem. The first part suggests a possible cause of the problem and the second suggests an action to take that would resolve it. I can't vouch for the answer's correctness, but it does look like an answer and not a comment or another question to me.Blandish
B
3

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!

Burney answered 19/11, 2014 at 14:23 Comment(1)
I didn't need to exclude anything. Looking at the solution's Properties window, the Active Config showed "Debug|Mixed Platforms". Changing it as you did and rebuilding fixed the issue.Nickelplate
D
1

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.

Disclose answered 22/12, 2014 at 15:17 Comment(0)
M
1

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.

Montano answered 4/10, 2015 at 15:43 Comment(1)
I had the same issue in Visual Studio 2017 RC, when opening the solution as a folder. This answer led me to open the .sln file directly in Visual Studio 2017, which solved my problem. Thank you!Incense
P
1

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

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

Phenolphthalein answered 1/11, 2023 at 6:13 Comment(0)
D
0

I changed to Any CPU and it worked for me.

Drews answered 17/11, 2022 at 15:6 Comment(0)
S
0

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

Skiles answered 29/11, 2022 at 14:17 Comment(0)
K
-2

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

That's all.

Knives answered 30/4, 2019 at 15:35 Comment(3)
Not sure what you mean, but my answer works and is unique, The other answers, as well, suppose that he isn't on a solution. Reproducing this, there's not on a solution.Zoba
there is no "solution" in file -> new for me, using VS 2019.Albur
@Albur This was asked 8 years ago for VS 2010 and works in VS Code and some other versions. Thank you for the info. The solution in VS 2019 is different, but I don't have it off-hand: feel free to add it to an edit or a comment if you find it.Zoba

© 2022 - 2024 — McMap. All rights reserved.