F5 or Start Debugging Button is Greyed Out for Win

2020-02-09 07:09发布

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.

7条回答
祖国的老花朵
2楼-- · 2020-02-09 07:51

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

查看更多
We Are One
3楼-- · 2020-02-09 07:51

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

That's all.

查看更多
Summer. ? 凉城
4楼-- · 2020-02-09 08:03

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!

查看更多
We Are One
5楼-- · 2020-02-09 08:06

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.

查看更多
家丑人穷心不美
6楼-- · 2020-02-09 08:06

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.

查看更多
小情绪 Triste *
7楼-- · 2020-02-09 08:08

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

查看更多
登录 后发表回答