When I hit F5 (debugging mode) nothing happens. Building works correctly, exe file I can launch properly, but can't start debug. Why?
-
And what does it say in the output window? – leppie Feb 21 '12 at 08:50
-
3What is set in 'Build' > 'Configuration Manager'? Is the project set with debug under the configuration column? – dougajmcdonald Feb 21 '12 at 08:51
-
@leppie Output window says nothng. After build is communicate "succeeded" but after try to debug just nothing – Saint Feb 21 '12 at 08:55
-
@Saint: Choose Debug from the dropdown in the Output window. – leppie Feb 21 '12 at 08:58
-
@leppie I try, but...there's no that option. Something is probably turn off, checked off...but what? – Saint Feb 21 '12 at 09:18
-
I know this could be lame, but does your keyboard have F lock so if you click on play the debugging is working? – Alex Feb 21 '12 at 08:53
-
Heh, no. I tried both methods – Saint Feb 21 '12 at 08:56
-
Clearly a different issue, but (for future travellers) I had a similar thing in VS2017 which was fixed by unchecking "Prefer 32 Bit": http://pmichaels.net/2017/05/21/console-application-builds-will-not-run/ – Paul Michaels May 21 '17 at 08:54
-
I found that the single instance (Mutex) I added in Program.cs caused debugging not to start when another built instance was running outside Visual Studio. – Ray Chakrit Jan 06 '23 at 14:16
31 Answers
I had the same problem and all the tricks didnt do it until I unchecked the "Enable the Visual Studio hosting process" under the debug tab in the project properties

- 2,128
- 5
- 23
- 33

- 5,940
- 3
- 33
- 47
-
4Thad fixed the issue for me. The short way to do this: http://msdn.microsoft.com/en-us/library/ms185330(v=vs.100).aspx – Claudiu Constantin May 27 '13 at 13:52
-
2
-
1to say the truth i am not really sure, would be happy for some1 to enlight us – bresleveloper Jun 08 '14 at 07:39
-
5Just in case: I had to restart VS in order to make this trick work, so keep in mind – ZuoLi Apr 24 '15 at 14:18
-
-
Had to do the uncheck, then restart VS. Just restarting VS wasn't enough for me. – vapcguy Jul 13 '16 at 15:35
-
2Thank you for this. Lost two hours of my life trying to solved this! – Paul Alexander Feb 02 '17 at 16:02
-
I know it's old, but for those who ran into the same issue, and still wondering what's the purpose of hosting process, here's a thread about that: https://stackoverflow.com/questions/2069940/what-is-the-purpose-of-the-visual-studio-hosting-process – grmihel Sep 08 '17 at 09:46
-
Ugh! I was experiencing the exact same symptoms you were, and after trying all the suggestions, the only one that worked was your own: creating a new project and copying all the contents across.
Then I noticed that I couldn't manually delete my Bin directory, and I realised that MyApp.vshost.exe had been running in the background this whole time, preventing itself from being overwritten by Visual Studio 2012. Not sure how it still worked from VS2010 though :/
In summary, the solution that worked for me: Kill the process, try again.
In other words, have you tried turning it off and on again?

- 4,165
- 3
- 34
- 45
-
This is common for all versions of Visual Studio - particularly when switching from Debug to Release and back again. If it throws a wobbler, closing and restarting Visual Studio seems to clear the locks. – GlennG Jun 02 '13 at 23:10
-
4True. Just to clarify for other readers, simply closing and restarting Visual Studio didn't help me. The process remained running in the background and needed to be manually killed. – mo. Jun 04 '13 at 18:09
-
12
-
I will add that when I had this problem the vshost process stayed in memory even after closing VS 2015. I finally killed the process itself and then all worked again. – Mike Cheel Feb 16 '16 at 18:05
-
For me, it was to restart Visual Studio, but the key was unchecking the "Enable the Visual Studio hosting process" check box, first. Just restarting Visual Studio was not enough. – vapcguy Jul 13 '16 at 15:34
Restart VS and try to debug. Some time it happens, even I also had the same problem.

- 704
- 1
- 7
- 16
Sorry to bring up an old question but I had the same problem today, but the reason was actually because of the build order of the solution.
If you go into the Solution Property Pages
-> Common Properties
-> Startup Project
.
The ensuring Multiple startup projects
is selected, move the web project to the top of the list.
In my web application solution I have 2 web projects and 5 code projects, one of my code projects was at the top, and as such debug would not start.
Hope others find this helpful

- 12,985
- 8
- 57
- 95

- 3,871
- 4
- 31
- 38
This solution has already been mentioned but it took some tinkering to make it work so here is a clear solution
- On the Project menu/tab, click Properties. (or on your solution explorer)
- Click the Debug tab.
- Clear the Enable the Visual Studio hosting process check box.(uncheck it)
- Check if it works.
If it does not restart your computer (some of the projects files run in the background if you know how to stop them then restarting is not necessary just end their tasks) rebuild the project
this should solve the problem
-
THANK YOU! Finally some clarity! Key is restarting VS after unchecking that box! – vapcguy Jul 13 '16 at 15:33
-
-
@henon that is because your processes that would stop this solution from working was not running. in my case and in vapcguy's case our projects had processes running in memory which was stopping the solution from working. after restarting or clearing these processes in the task manager this be similar to your case. – Neil Oct 16 '18 at 07:13
Before you go through an intense fix... try this!!!
Simply start the .exe file in your debug folder. "Do not close it!"
Start the debugger in Visual Studio. (i) An error should pop up... just say "no"
Close the ".exe" file you started in step "1."
Try again.
For some reason, visual studio was stuck on this app that i was building but this worked for me.

- 51
- 1
- 2
What helped me out of this issue:
- close solution
- remove solution.suo file
- reopen solution

- 4,795
- 3
- 35
- 30
First, in your project properties and in the Debug
tab, make sure that your Start Action
is set to Start Project
and not some other option that won't run. If that doesn't resolve it then:
Go to Tools -> Options -> Environment -> Keyboard
and in Show commands containing:
type Debug.Start
and make sure that Shortcuts for selected command:
is set to F5 (Global)
. Also make sure you do not have anything else mapped to F5 that might conflict.
Finally if this doesn't resolve your issue, then I suggest that you export your current environment settings as a backup, and then reset all environment settings completely. See if that resolves it, if it does not then reimport your old settings and try repairing visual studio.

- 13,558
- 5
- 50
- 76
-
-
`Tools -> Import and Export Settings`, and you can use this dialog to export and import settings as you please. This is also where you can reset environment settings to defaults. – David Anderson Feb 21 '12 at 09:08
-
-
Did you validate your project's Start Action? Is it a console application that executes quickly and then closes without pausing at the end? – David Anderson Feb 21 '12 at 10:58
I have very funny solution, but it worked for me,
Hold the F5 key until you see that the debugging started, I'm serious guys.

- 5,252
- 3
- 41
- 66
close your project then delete all files on yourproject\bin\Debug\ folder to make new debug solution

- 21
- 1
Quick fix that might help someone:
I am using VS2013 and my debugger suddenly stopped working. I kept getting a message box stating debugging is not supported.
I finally fixed it by clearing NATIVE checkbox under Debuggers in the Property Pages->Start Options tab for the start up project. I now only have ASP.NET selected under Debuggers.

- 544
- 5
- 10
Go to Solution Explorer, right-click your project go to properties, click Debug, at the bottom there is a check box, click the check box to Enable SQL Server Debugging.

- 11
- 1
Verify that in your Project -> Properties -> Debug tab -> Start Action sections that "Do not launch, but debug my code when it starts" is not checked. Somehow this got checked months after I created and had been working on my project.
Unchecking this solved my problem.

- 1,891
- 3
- 22
- 28
-
This option was on for me. Not sure how because it used to work. Seems like a useless option – Yasser Asmi Aug 19 '16 at 21:16
I had the same issue and while looking at bresleveloper's answer, I found the following issue which seemed to work for me. Posting this in case anyone else has the same issue, then they can check this as well.
Went to Debug Tab < Project Properties. Found that Debugging options were totally disabled. Checked the "Enable Debugging" check box. That did if for me..

- 95
- 1
- 4
-
This is essentially the same answer as [this older one](http://stackoverflow.com/a/9374545/1677912). If you see an answer that helps you, [upvote it](http://stackoverflow.com/help/privileges/vote-up) once you have sufficient privileges. – Mogsdad Aug 13 '15 at 19:25
-
Why did you down vote this??? Its there to help others without having to navigate to other places. Time to rethink what your doing before you did it. – Sleeping_Giant Aug 26 '15 at 20:42
-
1The answer in "other place" is an answer to this same question, so upvoting it _would_ make it easier for others to find without having to navigate. [That's how voting works](http://stackoverflow.com/help/why-vote). And please don't just assume I downvoted you: I _did_ comment, as helpful guidance, but voting is a separate activity, and could come from any member of the community with sufficient privileges. Keep at it, you'll get there. – Mogsdad Aug 26 '15 at 20:52
I faced this problem. In my case, somehow the startup project entry got cleared. So, make sure atleast one among the projects in your solution explorer is set as the startup project. To set up a startup project, right click on the desired project in the solution explorer --> click "Set as Startup Project"

- 1,613
- 1
- 16
- 23
I have found a solution:
- Close your Visual studio solution
- Open your
.csproj
project header with notepad ++ for example. - Search for
<UseIISExpress>false</UseIISExpress>
in the<PropertyGroup>
section - Change the value to true :
<UseIISExpress>true</UseIISExpress>
- Save
- Open your solution and for me now debug works on my project

- 8,356
- 19
- 50
- 61

- 1,741
- 2
- 16
- 26
I'm experiencing the same problem. I haven't been able to display the debug window, but I was able to redirect the debug output to the simplified 'immediate window' by checking the corresponding option in Debug->Options and Settings; only shows explicit Debug writes in the code like Debug.Writeline().
Visual Studio 2010
This process generally works for me:
- Close IE
- Use Task Manager to check that all instances of iexplore.exe have gone -- kill any remaining 'orphan' instances.
- Start IE from the start menu and make sure it starts up correctly.
- Clear Internet Explorer's cache & cookies and restart.
- Close Visual Studio to ensure all locks are released.
- IISReset
- Restart VS
- Clean the project/solution
- Recompile and it should work

- 2,982
- 2
- 20
- 25
I have found a solution:
- Close your Visual studio solution
- Open your .csproj project header with notepad ++ for example.
- Search for Tag in the section
- Remove Config Tag completly
- Open your solution and for me now debug works on my project

- 1
I had the same problem with my desktop application and as this forum says you should mark your project as a startup project, since visual studio has unmarked.
It worked just fine for me and I believe it will help other people that may have this problem.

- 44,709
- 21
- 151
- 275

- 197
- 7
- 21
Check Configuration Manager, make sure all projects are compiling for the same platform.

- 2,286
- 22
- 51
With regard to the problem above where the Console doesn't appear. (I don't have enough merit points to comment directly against that post.)
I disabled the hosting process in order to get around the problem of it being left running and leaving the files locked. When I did this I found my Console window no longer appeared when I hit F5 to debug, although my program ran fine. I then noticed that I had the "Prefer 32-bit" check-box ticked. I unticked this, rebuilt and the Console window appeared once more. This seemed strange so I ticked it off again and confirmed I can reproduce this behaviour. I'm using Visual Studio 2013.

- 1
- 1
For the new ASP.Net Core 1 app.
Under package management console, i ran
dnvm upgrade
dnvm restore
and my solution could compile.

- 6,330
- 3
- 35
- 52
My experience with Visual Studio 2015, I tried deleting all processes and restarting it didn't work. I tried deleting the bin directory, it didn't work.
Sadly, the only thing that worked was closing down and restarting Visual Studio 2015 in Admin mode. Sigh...

- 11,923
- 6
- 58
- 68
I was having the same issue (apparently several years later) where I could see my device in VS 2015, but when I wanted to debug on the device, nothing happened.
It may be a different issue than the one the original poster had, but this solution fixed the problem for me in VS 2015.
Right-click the solution and select Properties, and then notice if the checkbox for your solution in the Deploy column is checked, if it is not, then check it and try debugging again. Worked for me.

- 799
- 4
- 8
- 33
I had this problem in a WPF application I was working on. When running the debugger, a process named MyApp.VsHost.exe would start and continue running in the background, but there would be no exceptions thrown and nothing in the Output window except build information.
It was because I had changed the namespace of my App
class but did not update the Class
attribute in App.xaml
to match the new namespace. I changed the namespace in the xaml file and it worked again.

- 8,050
- 9
- 37
- 73
If you are working with an SSIS package or a solution with more than one application inside of it. Make sure you have the correct application set as your "Start up project".
If you have a separate application or SSIS project in the same folder, your Visual Studio is probably building that instead of what you want to run.
Hope this helps!

- 45
- 9
What worked for me was completely deleting the solution folder (had to reboot Windows to be allowed to do this), and then getting it back from source control. Sounds drastic - but it doesn't actually take very long.

- 4,700
- 3
- 29
- 28
Using Visual Studio 2017. Had dozen projects in a solution. Pressing debug would build with no error then do nothing.
Issue was one Project built to .Net 4.6 while the rest where .Net 4.0

- 3,387
- 1
- 22
- 27
I finally created other project and copied existing files and folders to it. Maybe 'unprofessional' but it's working :) Fortunately this is small project

- 5,397
- 22
- 63
- 107
-
I recently installed VS2012 and get this issue only with one project. It still works fine if I open it in VS2010. In VS2012, the application launches and runs fine if I choose Debug > Run Without Debugger. Like you, I tried all the other suggestions here, but none of them helped. I think your accepted answer here is the last resort, and this isn't a very small project :( – mo. Sep 25 '12 at 17:34
-
Even i am clicking multiple times on debug and run on my VS 12 like kicking to my old scooter and this doesn't work form my first 10+ attempts. – bijayk Aug 16 '13 at 15:46