When I hit F5 (debugging mode) nothing happens. Building works correctly, exe file I can launch properly, but can't start debug. Why?
问题:
回答1:
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:
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?
回答3:
Restart VS and try to debug. Some time it happens, even I also had the same problem.
回答4:
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
回答5:
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
回答6:
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.
回答7:
What helped me out of this issue:
- close solution
- remove solution.suo file
- reopen solution
回答8:
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.
回答9:
close your project then delete all files on yourproject\bin\Debug\ folder to make new debug solution
回答10:
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.
回答11:
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.
回答12:
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.
回答13:
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"
回答14:
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
回答15:
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
回答16:
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
回答17:
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
回答18:
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..
回答19:
Check Configuration Manager, make sure all projects are compiling for the same platform.
回答20:
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.
回答21:
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.
回答22:
For the new ASP.Net Core 1 app.
Under package management console, i ran
dnvm upgrade
dnvm restore
and my solution could compile.
回答23:
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...
回答24:
Same error, tried executing VS as Administrator and it worked.
回答25:
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.
回答26:
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.
回答27:
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!
回答28:
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.
回答29:
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
回答30:
I finally created other project and copied existing files and folders to it. Maybe 'unprofessional' but it's working :) Fortunately this is small project