I'm trying to debug a C# script using VSCode. but when I hit F5 it shows
But I do have the C# extension installed in VSCode
About my VSCode
Version: 1.56.2 (system setup)
Commit: 054a9295330880ed74ceaedda236253b4f39a335
Date: 2021-05-12T17:13:13.157Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Windows_NT x64 10.0.19042
I also have Dotnet installed on my machine
dotnet --version
5.0.203
Previously, VSCode used to resolve all the necessary dependencies and create the necessary files for debugging a C# script. Maybe the latest update has some issues?
If you have issues with that I suggest going to 'view' and then press command pallet or press Ctrl+Shift+P and then search 'generate assets for build and debug' and if you want it to open up a new window and execute your code instead of it running in the terminal: Go open .vscode Then select launch.json and then go to where it says console and write this instead:
"console": "externalTerminal",
I encountered the same issue. Projects always used to bolt up and run instantly in the past.
After some annoyance and searching around, I found a workaround. In the command palette, you can find the following command:
This revealed that in my case there were multiple unity processes running (even though I only had a single editor open). This may not be the case for you.
The correct one for me happened to be the second process on the list. Then, unity opened the following window, which I had never seen before
As far as I can tell, there have been updates that disable debugging by default. In the image below you will find the setting to enable/disable this.
Note: This can also be done using the shortcut at the bottom right hand corner of your editor: