Ошибка отладки visual studio

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

asked Feb 21, 2012 at 8:49

Saint's user avatar

9

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

Ḟḹáḿíṅḡ Ⱬỏḿƀíé's user avatar

answered Jul 9, 2012 at 12:09

bresleveloper's user avatar

bresleveloperbresleveloper

5,9403 gold badges33 silver badges47 bronze badges

9

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?

answered Sep 25, 2012 at 18:18

mo.'s user avatar

mo.mo.

4,1553 gold badges34 silver badges45 bronze badges

5

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

answered Feb 21, 2012 at 8:52

Sudik Maharana's user avatar

Sudik MaharanaSudik Maharana

6941 gold badge7 silver badges15 bronze badges

1

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

Lynn Crumbling's user avatar

answered Feb 22, 2013 at 13:08

dan richardson's user avatar

dan richardsondan richardson

3,8614 gold badges31 silver badges38 bronze badges

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

hogarth45's user avatar

hogarth45

3,3371 gold badge22 silver badges27 bronze badges

answered Mar 14, 2016 at 11:10

Neil's user avatar

NeilNeil

6411 gold badge7 silver badges21 bronze badges

3

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.

answered Sep 16, 2013 at 15:48

user1919208's user avatar

What helped me out of this issue:

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

answered Jun 9, 2016 at 15:04

Stefan Michev's user avatar

Stefan MichevStefan Michev

4,7773 gold badges35 silver badges30 bronze badges

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.

answered Feb 21, 2012 at 8:56

David Anderson's user avatar

David AndersonDavid Anderson

13.5k5 gold badges50 silver badges76 bronze badges

4

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.

answered Mar 6, 2013 at 13:22

Nour's user avatar

NourNour

5,1823 gold badges41 silver badges65 bronze badges

2

close your project then delete all files on yourprojectbinDebug folder to make new debug solution

answered Mar 20, 2013 at 2:57

user2189123's user avatar

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

answered Aug 17, 2017 at 12:08

Anthony De Souza's user avatar

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.

answered Apr 23, 2013 at 20:19

joa's user avatar

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.

answered May 22, 2013 at 17:10

jmurphy's user avatar

jmurphyjmurphy

1,8913 gold badges22 silver badges28 bronze badges

1

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

answered Jul 15, 2015 at 15:16

Sleeping_Giant's user avatar

3

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«

answered Jul 26, 2017 at 20:12

josepainumkal's user avatar

josepainumkaljosepainumkal

1,6131 gold badge15 silver badges23 bronze badges

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

answered Jan 29, 2013 at 8:45

user2020952's user avatar

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

answered Jun 2, 2013 at 23:07

GlennG's user avatar

GlennGGlennG

2,9722 gold badges20 silver badges25 bronze badges

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

Kevin Panko's user avatar

Kevin Panko

8,31819 gold badges49 silver badges61 bronze badges

answered Jan 23, 2013 at 12:39

toregua's user avatar

toreguatoregua

1,7312 gold badges16 silver badges26 bronze badges

1

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

answered Feb 19, 2015 at 12:30

Annye's user avatar

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

answered Aug 13, 2015 at 18:46

Denise Skidmore's user avatar

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.

Mogsdad's user avatar

Mogsdad

44.5k21 gold badges150 silver badges272 bronze badges

answered Jul 23, 2015 at 10:52

g_brahimaj's user avatar

g_brahimajg_brahimaj

1977 silver badges21 bronze badges

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.

answered Aug 18, 2015 at 10:02

David Priddle's user avatar

For the new ASP.Net Core 1 app.

Under package management console, i ran

dnvm upgrade
dnvm restore

and my solution could compile.

RoadieRich's user avatar

RoadieRich

6,2813 gold badges35 silver badges52 bronze badges

answered Mar 23, 2016 at 7:17

Tefo Motatamali's user avatar

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…

answered Jul 8, 2016 at 18:46

Chris Hawkes's user avatar

Chris HawkesChris Hawkes

11.8k6 gold badges57 silver badges67 bronze badges

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

answered Sep 11, 2016 at 4:20

andrepaulo's user avatar

andrepauloandrepaulo

81611 silver badges24 bronze badges

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

answered Oct 13, 2016 at 10:35

Aidal's user avatar

AidalAidal

7894 gold badges8 silver badges33 bronze badges

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.

answered Nov 20, 2016 at 17:28

JamesFaix's user avatar

JamesFaixJamesFaix

7,9036 gold badges36 silver badges73 bronze badges

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!

answered Aug 11, 2017 at 18:48

NickZeus's user avatar

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.

answered May 9, 2018 at 10:56

Graham Laight's user avatar

Graham LaightGraham Laight

4,6703 gold badges29 silver badges28 bronze badges

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

answered Jul 11, 2018 at 17:27

hogarth45's user avatar

hogarth45hogarth45

3,3371 gold badge22 silver badges27 bronze badges

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

asked Feb 21, 2012 at 8:49

Saint's user avatar

9

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

Ḟḹáḿíṅḡ Ⱬỏḿƀíé's user avatar

answered Jul 9, 2012 at 12:09

bresleveloper's user avatar

bresleveloperbresleveloper

5,9403 gold badges33 silver badges47 bronze badges

9

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?

answered Sep 25, 2012 at 18:18

mo.'s user avatar

mo.mo.

4,1553 gold badges34 silver badges45 bronze badges

5

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

answered Feb 21, 2012 at 8:52

Sudik Maharana's user avatar

Sudik MaharanaSudik Maharana

6941 gold badge7 silver badges15 bronze badges

1

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

Lynn Crumbling's user avatar

answered Feb 22, 2013 at 13:08

dan richardson's user avatar

dan richardsondan richardson

3,8614 gold badges31 silver badges38 bronze badges

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

hogarth45's user avatar

hogarth45

3,3371 gold badge22 silver badges27 bronze badges

answered Mar 14, 2016 at 11:10

Neil's user avatar

NeilNeil

6411 gold badge7 silver badges21 bronze badges

3

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.

answered Sep 16, 2013 at 15:48

user1919208's user avatar

What helped me out of this issue:

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

answered Jun 9, 2016 at 15:04

Stefan Michev's user avatar

Stefan MichevStefan Michev

4,7773 gold badges35 silver badges30 bronze badges

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.

answered Feb 21, 2012 at 8:56

David Anderson's user avatar

David AndersonDavid Anderson

13.5k5 gold badges50 silver badges76 bronze badges

4

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.

answered Mar 6, 2013 at 13:22

Nour's user avatar

NourNour

5,1823 gold badges41 silver badges65 bronze badges

2

close your project then delete all files on yourprojectbinDebug folder to make new debug solution

answered Mar 20, 2013 at 2:57

user2189123's user avatar

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

answered Aug 17, 2017 at 12:08

Anthony De Souza's user avatar

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.

answered Apr 23, 2013 at 20:19

joa's user avatar

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.

answered May 22, 2013 at 17:10

jmurphy's user avatar

jmurphyjmurphy

1,8913 gold badges22 silver badges28 bronze badges

1

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

answered Jul 15, 2015 at 15:16

Sleeping_Giant's user avatar

3

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«

answered Jul 26, 2017 at 20:12

josepainumkal's user avatar

josepainumkaljosepainumkal

1,6131 gold badge15 silver badges23 bronze badges

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

answered Jan 29, 2013 at 8:45

user2020952's user avatar

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

answered Jun 2, 2013 at 23:07

GlennG's user avatar

GlennGGlennG

2,9722 gold badges20 silver badges25 bronze badges

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

Kevin Panko's user avatar

Kevin Panko

8,31819 gold badges49 silver badges61 bronze badges

answered Jan 23, 2013 at 12:39

toregua's user avatar

toreguatoregua

1,7312 gold badges16 silver badges26 bronze badges

1

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

answered Feb 19, 2015 at 12:30

Annye's user avatar

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

answered Aug 13, 2015 at 18:46

Denise Skidmore's user avatar

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.

Mogsdad's user avatar

Mogsdad

44.5k21 gold badges150 silver badges272 bronze badges

answered Jul 23, 2015 at 10:52

g_brahimaj's user avatar

g_brahimajg_brahimaj

1977 silver badges21 bronze badges

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.

answered Aug 18, 2015 at 10:02

David Priddle's user avatar

For the new ASP.Net Core 1 app.

Under package management console, i ran

dnvm upgrade
dnvm restore

and my solution could compile.

RoadieRich's user avatar

RoadieRich

6,2813 gold badges35 silver badges52 bronze badges

answered Mar 23, 2016 at 7:17

Tefo Motatamali's user avatar

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…

answered Jul 8, 2016 at 18:46

Chris Hawkes's user avatar

Chris HawkesChris Hawkes

11.8k6 gold badges57 silver badges67 bronze badges

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

answered Sep 11, 2016 at 4:20

andrepaulo's user avatar

andrepauloandrepaulo

81611 silver badges24 bronze badges

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

answered Oct 13, 2016 at 10:35

Aidal's user avatar

AidalAidal

7894 gold badges8 silver badges33 bronze badges

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.

answered Nov 20, 2016 at 17:28

JamesFaix's user avatar

JamesFaixJamesFaix

7,9036 gold badges36 silver badges73 bronze badges

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!

answered Aug 11, 2017 at 18:48

NickZeus's user avatar

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.

answered May 9, 2018 at 10:56

Graham Laight's user avatar

Graham LaightGraham Laight

4,6703 gold badges29 silver badges28 bronze badges

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

answered Jul 11, 2018 at 17:27

hogarth45's user avatar

hogarth45hogarth45

3,3371 gold badge22 silver badges27 bronze badges

Visual Studio is a popular integrated development environment (IDE) for developers worldwide. However, sometimes you may encounter an error that says «Visual Studio cannot start debugging because the debug target is missing.» This guide will walk you through the steps to fix this issue and provide you with some frequently asked questions for further assistance.

Table of Contents

  1. Solution 1: Check Project Properties
  2. Solution 2: Rebuild the Solution
  3. Solution 3: Modify the Output Path
  4. Solution 4: Refresh the Debug Configuration
  5. Solution 5: Check the Debugger Settings
  6. FAQs

Solution 1: Check Project Properties

Step 1: Open Project Properties

In Visual Studio, right-click on your project in the Solution Explorer and select «Properties.»

Step 2: Verify the Start Action

Under the «Debug» tab, ensure that «Start Action» is set to «Start project» or «Start external program» with the correct path to the executable.

Step 3: Verify the Build Configuration

Under the «Build» tab, make sure that the «Configuration» drop-down menu is set to «Debug» mode.

Back to Table of Contents

Solution 2: Rebuild the Solution

Step 1: Clean the Solution

In Visual Studio, click on «Build» in the menu bar and select «Clean Solution.»

Step 2: Rebuild the Solution

Click on «Build» in the menu bar again and select «Rebuild Solution.»

Back to Table of Contents

Solution 3: Modify the Output Path

Step 1: Open Project Properties

Right-click on your project in the Solution Explorer and select «Properties.»

Step 2: Modify the Output Path

Under the «Build» tab, change the «Output path» to a different folder or revert to the default path (e.g., binDebug).

Back to Table of Contents

Solution 4: Refresh the Debug Configuration

Step 1: Open Configuration Manager

In Visual Studio, click on «Build» in the menu bar and select «Configuration Manager.»

Step 2: Refresh the Debug Configuration

In the Configuration Manager, change the «Active solution configuration» to «Release» and then back to «Debug.» Click «Close» to save the changes.

Back to Table of Contents

Solution 5: Check the Debugger Settings

Step 1: Open Visual Studio Options

In Visual Studio, click on «Tools» in the menu bar and select «Options.»

Step 2: Check the Debugger Settings

Under «Debugging» in the Options window, ensure that the settings are configured correctly, especially the «Just-In-Time» debugger settings.

Back to Table of Contents

FAQs

Q1: What causes the «Visual Studio cannot start debugging» error?

A1: The error occurs when Visual Studio cannot find the debug target, which is the executable that the debugger should attach to when starting the debug session. This may be caused by incorrect project settings, build configuration issues, or problems with the debugger settings.

Q2: Can I debug a project in Release mode?

A2: Yes, you can debug a project in Release mode, but it may be more challenging due to compiler optimizations and reduced debug information. It is recommended to debug in Debug mode for a smoother debugging experience.

Q3: What is the difference between Clean Solution and Rebuild Solution?

A3: «Clean Solution» removes all intermediate and output files generated during the build process, while «Rebuild Solution» performs a clean operation followed by a build operation.

Q4: How can I set a breakpoint in my code?

A4: In Visual Studio, click on the left margin of the code editor next to the line where you want to set a breakpoint. Alternatively, you can place the cursor on the line and press F9.

Q5: Can I change the debug target while the debugger is running?

A5: No, you cannot change the debug target while the debugger is running. You must stop the debugger, make the necessary changes, and then restart the debugging session.

Back to Table of Contents

For more information on debugging in Visual Studio, check out the official documentation.

If you encounter other Visual Studio errors, visit the Visual Studio Developer Community for support and resources.

  • Remove From My Forums
  • Вопрос

  • Здравствуйте. У меня не работает отладка в вышеупомянутой студии. Символы установлены, путь к ним указан. Но при нажатии F11, сообщение, что не хватает файлов и предлагает найти их самостоятельно. Подскажите, пожалуйста, в
    чём проблема, что неправильно делаю? Студия установлена в  Windows 10.

    • Изменен тип

      17 августа 2015 г. 6:47
      тема не активна

    • Изменен тип
      Maksim MarinovMicrosoft contingent staff, Moderator
      17 августа 2015 г. 6:47
      ошибка

Ответы

  • Приложение Windows начинает исполнение кода не с главной функции Вашей программы. Главная функция вызывается средой .net после некоторых подготовительных операций. Запуск отладки клавишами F10-F11, предназначенными для пошаговой
    отладки останавливают программу именно в этом «подготовительном» коде, исходный код которого, действительно, отсутствует. И символы здесь не помогут. Отладку следует начинать с установки точек прерывания
    в своем коде, а запускать клавишей F5.


    Если сообщение помогло Вам, пожалуйста, не забудьте отметить его как ответ данной темы. Удачи в программировании!

    • Помечено в качестве ответа
      Sergey_Bogatov
      17 августа 2015 г. 14:01

  • А это предупреждение говорит о том, пошаговая отладка аксессоров get и set свойств отключена (по умолчанию, действительно, так и есть) и предлагает ее включить.


    Если сообщение помогло Вам, пожалуйста, не забудьте отметить его как ответ данной темы. Удачи в программировании!

    • Помечено в качестве ответа
      Sergey_Bogatov
      17 августа 2015 г. 14:01

  • Сначала точки прерывания, потом F5, после остановки программы в нужном месте начинайте двигаться по шагам, если требуется. Отпустить программу до следующей точки — снова по f5 и т.д. Но имейте ввиду,
    что шаг с заходом в функцию или свойство не из Вашего кода опять приведет к подобному сообщению.


    Если сообщение помогло Вам, пожалуйста, не забудьте отметить его как ответ данной темы. Удачи в программировании!

    • Помечено в качестве ответа
      Sergey_Bogatov
      17 августа 2015 г. 19:08

На чтение 10 мин Просмотров 5к. Опубликовано 31.07.2020

Содержание

  1. Решение
  2. Другие решения
  3. 29 ответов
  4. Хабр Q&A — вопросы и ответы для IT-специалистов

Я только что сделал новый проект Console Aplication в Visual Studio C ++. Я изменил настройки, чтобы увидеть консоль при компиляции&запустить (CTRL + F5).
Однако, когда дело доходит до запуска в режиме отладки (F5), программа заканчивается, даже если у меня есть точки останова в нескольких местах.
Красные круги становятся белыми и имеют восклицательный знак в течение этих 2 секунд, пока он пытается отладить.
Кто-нибудь знает, как это исправить?

Решение

(1) Убедитесь, что ваше приложение находится в режиме отладки (не в режиме выпуска).

(2) Пожалуйста, включите параметры, такие как следующий снимок экрана.

Другие решения

Есть несколько вещей, которые вы можете проверить.

Прежде всего убедитесь, что код, в котором установлена ​​точка останова, достижим. Поместите его в точку входа вашего приложения.

Есть вероятность, что символы отладки где-то перепутались. Следовательно, попробуйте очистить / перестроить проект (вы можете попробовать удалить каталог bin / build вручную).

В Build-> Configuration Manager вы также можете проверить, действительно ли «Отладка» для конфигурации решения заставляет ваш проект выполняться в режиме отладки.

94 Saint [2012-02-21 11:49:00]

Когда я нахожу F5 (режим отладки), ничего не происходит. Строение работает правильно, exe файл, который я могу запустить правильно, но не могу запустить debug. Почему?

debugging c# build visual-studio-2010 .net-2.0

29 ответов

У меня была та же проблема, и все трюки не сделали этого, пока я не снял флажок «Включить хостинг Visual Studio» на вкладке отладки в свойствах проекта

45 mo. [2012-09-25 21:18:00]

Тьфу! Я испытывал те же самые симптомы, что и вы, и после того, как вы пробовали все предложения, единственным, кто работал, был ваш собственный: создание нового проекта и копирование всего содержимого.

Затем я заметил, что я не могу вручную удалить свой каталог Bin, и я понял, что MyApp.vshost.exe все время работал в фоновом режиме, не позволяя себе перезаписывать Visual Studio 2012. Не знаю, как это сделать все еще работал с VS2010:/

В итоге, решение, которое сработало для меня: Убейте процесс, повторите попытку.

Другими словами, вы пытались отключить и снова включить?

Перезагрузите VS и попробуйте отладить. Некоторое время это случается, даже у меня также была та же проблема.

Извините, что поставил старый вопрос, но сегодня у меня была такая же проблема, но причина была в том, что из-за порядка сборки решения. Если вы перейдете в Solution Property Pages → Common Properties → Startup Project .
Выбрано Multiple startup projects , переместите веб-проект в начало списка.

В моем решении для веб-приложений у меня есть 2 веб-проекта и 5 проектов кода, один из моих проектов кода был наверху, и поэтому отладка не запускалась.

Надеемся, что другие найдут это полезным

5 Neil [2016-03-14 14:10:00]

Это решение уже было упомянуто, но для его работы потребовалось некоторое вмешательство, поэтому ясное решение

На вкладке «Проект/вкладка» выберите «Свойства». (или в вашем браузере решений) Перейдите на вкладку «Отладка». Снимите флажок Включить процесс хостинга Visual Studio. (Снимите флажок) проверьте, работает ли он. если он не перезагружает ваш компьютер (некоторые из файлов проектов работают в фоновом режиме, если вы знаете, как их остановить, перезапуск не обязательно просто заканчивает их задачи) перестроить проект

это должно решить проблему

Что помогло мне решить эту проблему:

  • закрыть решение
  • удалить файл solution.suo
  • повторно открыть решение

Перед тем, как пройти интенсивное исправление. попробуйте это!

Просто запустите файл .exe в папке отладки. «Не закрывай!»

Запустите отладчик в Visual Studio. (i) Должна появиться ошибка. просто скажите «нет»

Закройте файл «.exe», который вы начали на этапе «1».

По какой-то причине визуальная студия застряла в этом приложении, которое я строю, но это сработало для меня.

Во-первых, в свойствах проекта и на вкладке Debug убедитесь, что ваш Start Action установлен на Start Project , а не какой-либо другой параметр, который не будет работать. Если это не разрешило, то:

Перейдите к Tools -> Options -> Environment -> Keyboard и в Show commands containing: введите Debug.Start и убедитесь, что для параметра Shortcuts for selected command: установлено значение F5 (Global) . Также убедитесь, что у вас нет ничего другого, сопоставленного с F5, который может конфликтовать.

Наконец, если это не решит вашу проблему, я предлагаю вам экспортировать текущие настройки среды в качестве резервной копии, а затем reset все настройки среды полностью. Посмотрите, разрешит ли это, если нет, а затем reimport ваши старые настройки и попробуйте восстановить визуальную студию.

закройте проект и удалите все файлы в папке projectinDebug , чтобы создать новое решение для отладки

1 joa [2013-04-23 23:19:00]

Перейдите в Обозреватель решений, щелкните правой кнопкой мыши проект, перейдите в свойства, нажмите «Отладка», внизу снимок установлен, установите флажок «Включить отладку SQL Server».

1 jmurphy [2013-05-22 20:10:00]

Убедитесь, что на вкладке «Проект» → «Свойства» → «Отладка» → «Начало действия», которые «Не запускать, но отлаживать мой код при запуске», не проверяется. Как-то это прошло через месяц после того, как я создал и работал над моим проектом.

Отметив это, я решил проблему.

У меня была такая же проблема с моим настольным приложением, и как этот форум говорит, что вы должны пометить свой проект как проект запуска, поскольку визуальная студия без опознавательных знаков.

Это сработало для меня отлично, и я считаю, что это поможет другим людям, которые могут иметь эту проблему.

0 Aidal [2016-10-13 13:35:00]

У меня была такая же проблема (видимо, несколько лет спустя), где я мог видеть свое устройство в VS 2015, но когда я хотел отлаживать устройство, ничего не происходило.

Это может быть другой вопрос, чем тот, который был у оригинального плаката, но это решение устранило проблему для меня в VS 2015.

Щелкните правой кнопкой мыши решение и выберите «Свойства», а затем отметьте, установлен ли флажок для вашего решения в столбце «Развернуть», если это не так, проверьте его и повторите попытку отладки. Работал для меня.

У меня была эта проблема в приложении WPF, над которым я работал. При запуске отладчика процесс с именем MyApp.VsHost.exe запускается и продолжает работать в фоновом режиме, но исключений не было бы выбрано и ничего в окне вывода, кроме информации о сборке.

Это произошло потому, что я изменил пространство имен моего класса App , но не обновил атрибут Class в App.xaml , чтобы соответствовать новому пространству имен. Я изменил пространство имен в файле xaml, и он снова работал.

Быстрое исправление, которое может помочь кому-то:

Я использую VS2013, и мой отладчик внезапно перестает работать. Я продолжал получать окно с сообщением о том, что отладка не поддерживается.

Наконец, я установил его с помощью флажка очистки NATIVE в разделе «Отладчики» на вкладке «Свойства страницы- > » Пуск «для запуска проекта. Теперь у меня только ASP.NET, выбранный под Debuggers.

Если вы работаете с пакетом SSIS или с решением с несколькими приложениями внутри него. Удостоверьтесь, что у вас есть правильный набор приложений в качестве «Начального проекта».

Если у вас есть отдельный проект приложения или SSIS в той же папке, ваша Visual Studio, вероятно, создает это вместо того, что вы хотите запустить.

Надеюсь, это поможет!

У меня была такая же проблема, и, глядя на ответ брзлвеловера, я нашел следующую проблему, которая, казалось, работала для меня. Проводя это, если кто-то другой имеет такую ​​же проблему, они также могут проверить это.

0 Annye [2015-02-19 15:30:00]

Я нашел решение:

  • Закройте решение для Visual Studio
  • Откройте заголовок проекта .csproj с помощью блокнота ++, например.
  • Поиск тегов в разделе
  • Удалить тег конфигурации полностью
  • Откройте свое решение, и для меня теперь отладка работает над моим проектом.

0 GlennG [2013-06-03 02:07:00]

Этот процесс обычно работает для меня:

  • Закрыть IE
  • Используйте диспетчер задач, чтобы проверить, что все экземпляры iexplore.exe ушли — kill любые оставшиеся «сироты».
  • Запустите IE из меню «Пуск» и убедитесь, что он запущен правильно.
  • Очистить кеш-кеш Internet Explorer и файлы cookie и перезапустить.
  • Закройте Visual Studio, чтобы освободить все блокировки.
  • IISReset
  • Перезапустить VS
  • Очистить проект/решение
  • Перекомпилируйте и он должен работать

0 toregua [2013-01-23 15:39:00]

Я нашел решение:

  • Закройте решение для Visual Studio
  • Откройте заголовок проекта .csproj с помощью блокнота ++, например.
  • Найдите false в разделе
  • Измените значение на true: true
  • Сохранить
  • Откройте свое решение, и для меня теперь отладка работает над моим проектом.
  • У меня такая же проблема. Я не смог отобразить окно отладки, но мне удалось перенаправить вывод отладки в упрощенное «ближайшее окно», проверив соответствующую опцию в Debug- > Options and Settings; только показывает явные отладочные записи в коде типа Debug.Writeline().

    Visual Studio 2010

    Для нового приложения ASP.Net Core 1.

    В консоли управления пакетами я запустил

    и мое решение могло бы скомпилироваться.

    Такая же ошибка, попробовал выполнить VS как Администратор, и он сработал.

    Я столкнулся с этой проблемой. В моем случае, как-то пропустили проект проекта запуска. Поэтому убедитесь, что один из проектов в вашем решении explorer задан как проект запуска. Чтобы настроить проект запуска, щелкните правой кнопкой мыши по желаемому проекту в проводнике решений → нажмите » Установить как проект запуска«

    Мой опыт работы с Visual Studio 2015, я попробовал удалить все процессы и перезапустить, это не сработало. Я попытался удалить каталог bin, это не сработало.

    К сожалению, единственное, что сработало, — это закрыть и перезапустить Visual Studio 2015 в режиме администратора. Вздох.

    Проверьте Configuration Manager, убедитесь, что все проекты компилируются для одной и той же платформы.

    Что касается проблемы выше, где консоль не отображается. (У меня недостаточно очков для комментариев, чтобы прокомментировать это сообщение.)

    Я отключил процесс хостинга, чтобы обойти проблему его оставления и оставить файлы заблокированными. Когда я это сделал, я обнаружил, что окно консоли не появилось, когда я ударил F5 для отладки, хотя моя программа прошла нормально. Затем я заметил, что у меня установлен флажок «Предпочтительный 32-разрядный». Я отмахивался от этого, перестроил и окно консоли появилось еще раз. Это показалось странным, поэтому я снова отметил его и подтвердил, что могу воспроизвести это поведение. Я использую Visual Studio 2013.

    -1 Saint [2012-02-21 12:36:00]

    Наконец я создал другой проект и скопировал существующие файлы и папки. Может быть, «непрофессиональный», но он работает:) К счастью, это небольшой проект

    У меня очень смешное решение, но это сработало для меня,

    Удерживайте клавишу F5, пока не увидите, что отладка началась, я серьезный парень.

    Сообщество, где люди делятся уникальным опытом

    Вопросы и ответы по любой теме от IT сообщества

    Помогаем строить карьеру в IT-индустрии

    Биржа удаленной работы для IT-специалистов

    Хабр Q&A — вопросы и ответы для IT-специалистов

    Получайте ответы на вопросы по любой теме из области IT от специалистов в этой теме.

    Понравилась статья? Поделить с друзьями:

    Не пропустите эти материалы по теме:

  • Яндекс еда ошибка привязки карты
  • Ошибка открытия файла 1с документооборот
  • Ошибка откуда слово
  • Ошибка открытия устройства воспроизведения sprecord 3
  • Ошибка открыть фьюзер xerox 3025

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии