Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio can't debug, can only attach [closed]

I cannot press F5 to debug my program, because there is only an Attach... button instead of a Debug button.

I am using a .c source file, and I was able to debug my sources until I changed a .cpp to a .c and now every source file I open, it says "Attach...". What do I do?

like image 329
user3179229 Avatar asked Jan 18 '14 22:01

user3179229


People also ask

Why does Visual Studio say attach instead of run?

You need to create a new Python related project(or open a Python project) in Visual Studio to debug your project which includes the . py file and python codes. Just open a single . py file is not enough to debug the project in Visual Studio, so you will see the “Start” changed to “Attach…”.

Why my breakpoints are not working?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.

Why is my debugger not working in VS Code?

Debugger not working Look at the debugger console for any error messages displayed. Look at the Debugger Tools console output for any errors. Remember to re-start VS Code once done (this won't be necessary in a future release). Solution: Clear all expressions from the debugger Watch window and start debugging again.


1 Answers

Try menu ToolsCustomizeCommandsAdd command...[button]Debug (under Categories). Find and add the button you would like to.

Also try setting your project to startup one - in Solution Explorer - right click on the project and choose the Set as Startup project option.

like image 177
user3140854 Avatar answered Sep 23 '22 14:09

user3140854