I want to try Visual Studio Code to compile the typical "Hello World" in C#. I did the following:
dotnet new console
but, unlike the tutorials I see on the web, nothing happens. The project is not created but I do not see any error messages either.
I appreciate the help to know how to create, edit and compile a project in C# from Visual Studio Code.
This might be a late one, but I hope it helps.
I assume that you have .Net already installed, you can check by opening the cmd and run the command dotnet --version
I also assume that you have installed Visual Studio.
Here are a few steps I took to run the C# code using visual studio.
extensions on your visual studio, click on Extensions icon. On the search field, type Code Runner, choose the first option and click on the installFile > Preferences > Settings from Visual Studiorun in terminal and scroll down the page. Enable the Run in terminal for the code runner as shown in the image Below.
Open Settings JSON button shown in the Top right (second after the run icon) as shown below
The resulting window is as below. Add a comma (,) at the end of the existing setting, then type code runner, choose the option with code-runner.executorMap

cd $dir && dotnet run $fileName
File>Save or Ctrl+SYey!!! You can now run your code by clicking the run button or using code runner
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With