5

How do you debug C# in Visual Studio Code on Windows?

I have an aspnet core project set up, I can build and edit it in VS Code and it works great.

I've installed the C# Omnisharp extension as per all of the getting started guides show and it's really easy to get going, except for one hugely important thing...

How do you actually debug it on Windows? Every article / blog post that I've come across only shows C# debugging with OSX or Linux.

Debugging with Mono doesn't work, I get the following:

Mono Debug is not supported on this platform (Win32NT).

And you can't install the Mono-Debugger extension on Windows - only OSX and Linux. Which makes sense, but what are the steps to do this with Windows?

I must be missing something really easy - how do I set up C# debugging with Visual Studio Code on Windows?

1 Answer 1

1

I've stumbled upon it myself and found the answer in instalation guide of debugger:

https://marketplace.visualstudio.com/items?itemName=Unity.unity-debug

You should check whether you have launch.json file already. If so, delete it and after clicking a cogwheel on top of debug view, select Unity Editor from dropdown.

There is also a VSCode Unity plugin, which may overwrite the file every time you start the game in the editor. To disable this uncheck the "Edit/Preferences/VSCode/Always Write Launch File" checkbox

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.