Use VS Code to Develop ASP. NET Core applications

Source: Internet
Author: User
Tags install node

Use VS Code to Develop ASP. NET Core applications

Use VS Code to Develop ASP. NET Core applications

Preparation

1. Install VS Code https://code.visualstudio.com/

2. Install Node. js https://nodejs.org/

Install ASP. NET Core and DNX

First install DNVM

CMD
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch='dev';$wc=New-Object System.Net.WebClient;$wc.Proxy=[System.Net.WebRequest]::DefaultWebProxy;$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;Invoke-Expression ($wc.DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}"
Powershell
&{$Branch='dev';$wc=New-Object System.Net.WebClient;$wc.Proxy=[System.Net.WebRequest]::DefaultWebProxy;$wc.Proxy.Credentials=[System.Net.CredentialCache]::DefaultNetworkCredentials;Invoke-Expression ($wc.DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))}

Select either of them.

After the installation, you can use the dnvm command.

Input in cmd

where dnvm

The dnvm installation path is displayed.

Install and generate an ASP. NET Core application tool

Input in cmd

npm install -g yo generator-aspnet gulp bower

If there is no npm, install the npm environment first.

After installing yo, we can use yo to generate an ASP. NET Core application.

Input in cmd

yo aspnet

Select Web Application and enter the name. The program will be generated soon.

Use VS Code to open a folder.

Run the VS Code command line in F1 and enter dnx: Restore Packages and press Enter.

 

After restoration, Run F1 to open the VS Code Command line and enter dnx: Run Command and press Enter.

Select dnx web. The following interface is displayed and runs successfully.

 

Enter http: // localhost: 5000/in the address bar of the browser/

 

VS Code cannot debug ASP. NET Core for the moment. We hope the official version can be used for debugging and development.

There is no problem with VS Code writing, and smart prompts are all complete.

Reference:

Https://code.visualstudio.com/docs/runtimes/ASPnet5

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.