Debugging doesn't start

C#Visual Studio-2010DebuggingBuild.Net 2.0

C# Problem Overview


When I hit F5 (debugging mode) nothing happens. Building works correctly, exe file I can launch properly, but can't start debug. Why?

C# Solutions


Solution 1 - C#

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

Solution 2 - C#

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?

Solution 3 - C#

Restart VS and try to debug. Some time it happens, even I also had the same problem.

Solution 4 - C#

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

Solution 5 - C#

This solution has already been mentioned but it took some tinkering to make it work so here is a clear solution

  1. On the Project menu/tab, click Properties. (or on your solution explorer)
  2. Click the Debug tab.
  3. Clear the Enable the Visual Studio hosting process check box.(uncheck it)
  4. 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

Solution 6 - C#

Before you go through an intense fix... try this!!!

  1. Simply start the .exe file in your debug folder. "Do not close it!"

  2. Start the debugger in Visual Studio. (i) An error should pop up... just say "no"

  3. Close the ".exe" file you started in step "1."

  4. Try again.

For some reason, visual studio was stuck on this app that i was building but this worked for me.

Solution 7 - C#

What helped me out of this issue:

  • close solution
  • remove solution.suo file
  • reopen solution

Solution 8 - C#

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.

Solution 9 - C#

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.

Solution 10 - C#

close your project then delete all files on yourproject\bin\Debug\ folder to make new debug solution

Solution 11 - C#

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.

enter image description here

Solution 12 - C#

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.

Solution 13 - C#

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.

Solution 14 - C#

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..

Solution 15 - C#

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"

Solution 16 - C#

I have found a solution:

  1. Close your Visual studio solution

  2. Open your .csproj project header with notepad ++ for example.

  3. Search for <UseIISExpress>false</UseIISExpress> in the <PropertyGroup> section

  4. Change the value to true : <UseIISExpress>true</UseIISExpress>

  5. Save

  6. Open your solution and for me now debug works on my project

Solution 17 - C#

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

Solution 18 - C#

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

Solution 19 - C#

I have found a solution:

  1. Close your Visual studio solution
  2. Open your .csproj project header with notepad ++ for example.
  3. Search for Tag in the section
  4. Remove Config Tag completly
  5. Open your solution and for me now debug works on my project

Solution 20 - C#

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.

Solution 21 - C#

Check Configuration Manager, make sure all projects are compiling for the same platform.

Solution 22 - C#

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.

Solution 23 - C#

For the new ASP.Net Core 1 app.

Under package management console, i ran

dnvm upgrade
dnvm restore

and my solution could compile.

Solution 24 - C#

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...

Solution 25 - C#

Same error, tried executing VS as Administrator and it worked.

Solution 26 - C#

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.

enter image description here

Solution 27 - C#

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.

Solution 28 - C#

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".

Start Up Project View

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!

Solution 29 - C#

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.

Solution 30 - C#

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

Solution 31 - C#

I finally created other project and copied existing files and folders to it. Maybe 'unprofessional' but it's working :) Fortunately this is small project

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSaintView Question on Stackoverflow
Solution 1 - C#bresleveloperView Answer on Stackoverflow
Solution 2 - C#mo.View Answer on Stackoverflow
Solution 3 - C#Sudik MaharanaView Answer on Stackoverflow
Solution 4 - C#dan richardsonView Answer on Stackoverflow
Solution 5 - C#NeilView Answer on Stackoverflow
Solution 6 - C#user1919208View Answer on Stackoverflow
Solution 7 - C#Stefan MichevView Answer on Stackoverflow
Solution 8 - C#David AndersonView Answer on Stackoverflow
Solution 9 - C#NourView Answer on Stackoverflow
Solution 10 - C#user2189123View Answer on Stackoverflow
Solution 11 - C#Anthony De SouzaView Answer on Stackoverflow
Solution 12 - C#joaView Answer on Stackoverflow
Solution 13 - C#jmurphyView Answer on Stackoverflow
Solution 14 - C#Sleeping_GiantView Answer on Stackoverflow
Solution 15 - C#josepainumkalView Answer on Stackoverflow
Solution 16 - C#toreguaView Answer on Stackoverflow
Solution 17 - C#user2020952View Answer on Stackoverflow
Solution 18 - C#GlennGView Answer on Stackoverflow
Solution 19 - C#AnnyeView Answer on Stackoverflow
Solution 20 - C#g_brahimajView Answer on Stackoverflow
Solution 21 - C#Denise SkidmoreView Answer on Stackoverflow
Solution 22 - C#David PriddleView Answer on Stackoverflow
Solution 23 - C#Tefo MotatamaliView Answer on Stackoverflow
Solution 24 - C#Chris HawkesView Answer on Stackoverflow
Solution 25 - C#andrepauloView Answer on Stackoverflow
Solution 26 - C#AidalView Answer on Stackoverflow
Solution 27 - C#JamesFaixView Answer on Stackoverflow
Solution 28 - C#NickZeusView Answer on Stackoverflow
Solution 29 - C#Graham LaightView Answer on Stackoverflow
Solution 30 - C#hogarth45View Answer on Stackoverflow
Solution 31 - C#SaintView Answer on Stackoverflow