Install the last version of .NET from here, and Download whatever the available version is for your computer.
If you don’t have node installed on your PC, I would recommend you to use node.js with NVM ( Node Version Manager), which it allows you to quickly switch between different version of node. If you install nodes directly, then you need to uninstall and then reinstall a later version. But if you use NVM, will allow you to switch between different version of Node when you want. You can find the instruction on how to install Node.js with NVM here.
Other wise, you can download the last stable version of nodejs (LTS), from the official website: nodejs.org
First of all, we will create a solution file which will be a container for our project, and we will create a project template as well. And one that we’re going to use is the ASP.NET Core Web API
Now, we can open our project inside Visual Studio Code. If you don’t have VS code already installed in your pc, you can download for free form here.
In order to compile and debug C# code inside Visual Studio Code, we need to install some extensions:
After that, go to View and select Command Pallete, and search for assets, and click on .NET Generate Assets for Build and Debug
The next extension what we need is C# Extensions. This extension will allow us to create classes by clicking a folder and creating new class and it’ll give us a template for that class.
Go in API folder and type the command:
This tells us is that our application is now listening on page to localhost:5001 and in localhost:5000. So we’ve got an HTTP address and we’ve got ass well an HTTPS address.
For this https address, we need to make sure our browser trust the certificate that is provided with .net SDK and what we need to do that is tu use the command :
dotnet dev-certs https –trust
To check if the application working, type in browser:
If every thing work fine, you will get a page similar with this:
Congratulations, you’re done setting up the development environment for .NET API Project, and setting up Visual Studio Code to work with C#