Getting started with asp.net-core – Using Visual Studio code to develop Cross plateform aspnet core application

With AspNetCore you can develop the application on any platform including Mac,Linux,Window and Docker.

Installation and SetUp

  1. Install visual Studio Code from here
  2. Add C# extesnion
  3. Install dot net core sdk. You can install from here

Now you have all the tools available. To develop the application. Now you need some scaffolding option. For that you should consider using Yeoman. To install Yeoman

  1. Install NPM. For this you need Node on your machine. Install from here

  2. Install Yeoman by using NPM

    npm install -g yo

  3. Now install the aspnet generator

    npm install -g generator-aspnet

Now we have all the setup on your machine. First let’s create a new project with DotNetCore basic command and then create a new project using Yo.

New Project Using Command Line

  1. Create a new Project Folder

    mkdir CoreApplication
    cd CoreApplication

  2. Scaffold a very basic dotnet project using default command line option

    dotnet New

New Project

  1. Restore the packages and run the application

    dotNet restore
    dotnet run
    enter image description here

Use Yeoman as Scaffolding Option

Create Project Folder and Run the Yo Command

yo aspnet

Yeoman will ask some inputs like Project Type, Project Name etc like

enter image description here

enter image description here

Now restore the packages by running dotnet restore command and Run the application

Use VS Code to develop the application

Run the visual studio code like
enter image description here

Now open the files and run the application. You can also search the extension for your help.

if you want to reproduce, please indicate the source:
Getting started with asp.net-core – Using Visual Studio code to develop Cross plateform aspnet core application - CodeDay