Home > Software design >  Why is debug not working on Visual Studio?
Why is debug not working on Visual Studio?

Time:01-25

I'm just a begginer with C#, I wanted to start to code but when I try to debug my code, the debug part is not avaiable to be used, I'm not sure what's wrong with the app or if it's a problem with my computer, which runs Windows 11

Hope you can help me out.

Thanks in advance. Here's the problem

I tried to uninstall visual studio several times, also watched some videos related to it but it was a complete waste of time.

CodePudding user response:

I can reproduce your situation:

enter image description here

This issue comes from your code is not be recognized as Project/Solution.

C# is different from the language like python, open the script file directly will not make it be able to debug/run.

So the solution is creating a minimal structure.

You can follow the below steps to start a demo C# code.

enter image description here

enter image description here

enter image description here

enter image description here

After the above steps, you will be able to debug the C# code:

enter image description here

CodePudding user response:

Check to see if you are running in debug mode or release mode.

  • Related