简体   繁体   中英

Why is debug not working on Visual Studio?

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.这是问题所在

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

I can reproduce your situation:

在此处输入图像描述

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.

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

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

在此处输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM