23

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.

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
  • 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 problem – Kamran Shahid Mar 14 '14 at 07:56
  • Did you try restarting your system? – Max Mar 14 '14 at 08:11

9 Answers9

39

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

Kamaro
  • 955
  • 1
  • 10
  • 11
20

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

Rahul Tripathi
  • 168,305
  • 31
  • 280
  • 331
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.

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
Chiko
  • 81
  • 4
  • If you have a new question, please ask it by clicking the [Ask Question](http://stackoverflow.com/questions/ask) button. Include a link to this question if it helps provide context. –  Jun 12 '14 at 05:32
  • 1
    Hi Paulchen, I don't have a new question this post was meant to be provided as an answer to the following posts - https://stackoverflow.com/a/22399535/3732249 and - https://stackoverflow.com/q/22398767/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. – Chiko Jun 12 '14 at 06:05
  • 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. – Pops Jun 13 '14 at 03:59
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!

Hernaldo Gonzalez
  • 1,977
  • 1
  • 21
  • 32
  • 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. – mono código Jan 11 '19 at 02:06
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.

Franky Rivera
  • 553
  • 8
  • 20
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.

Spencer Williams
  • 821
  • 10
  • 20
  • 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! – arni Nov 29 '16 at 08:29
0

I changed to Any CPU and it worked for me.

0

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

Reinaldo
  • 4,556
  • 3
  • 24
  • 24
-2

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

That's all.

Wolfpack'08
  • 3,982
  • 11
  • 46
  • 78
  • 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. – Wolfpack'08 Jul 11 '19 at 20:32
  • there is no "solution" in file -> new for me, using VS 2019. – xdavidliu Dec 08 '19 at 16:53
  • @xdavidliu 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. – Wolfpack'08 Nov 25 '22 at 14:29