Developing an ASP. NET 5 application using vs code

Source: Internet
Author: User

This article has briefly translated the Https://code.visualstudio.com/Docs/runtimes/ASPnet5 and made some explanations in combination with my practice.

Preparatory work

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

2. Install Nodejs https://nodejs.org/en/

Installing DNVM

The full name of DNVM is. NET Version Manager, an underlying tool for supporting the next generation of ASP. Cross-platform (WINDOWS,LINUX,MAC) support.

Https://github.com/aspnet/home#upgrading-dnvm-or-running-without-visual-studio

Run cmd under Windows, and then execute the following command

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "&{$Branch=‘dev‘;iex ((new-object net.webclient).DownloadString(‘https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1‘))}"
为了检验是否安装成功,可以执行dnvm试试看,如果看到下面这样的输出,则表示你的安装是成功的
Next, install the necessary runtime (runtime). DNVM is used to manage different runtimes. Currently supports two different types of get runtime, one is the traditional. NET CLR, one is the lite version of the CLR, the current Microsoft-defined name is CORECLR

This coreclr is completely open source, please refer to HTTPS://GITHUB.COM/DOTNET/CORECLR

You can use the following command to install the latest version of the runtime (requires dynamic download, may take some time)

DNVM Install Latest-arch x64-r CLR installs the latest version of the 64-bit CLR runtime (currently 4.5.1)

DNVM Install Latest-arch x64-r CORECLR installs the latest version of the 64-bit CORECLR runtime

After the installation is successful, you can use the following command to view all the runtime

In the following directory, you can also see the corresponding file

Install some of the necessary tools to generate an ASP. NET 5 Application
npm install -g yo grunt-cli generator-aspnet bower

This command is to use NPM, the Package Manager, installs a series of Nodejs modules, if you do not know much about them, please ignore them directly. Study again later.

You can then use the Yo tool to generate an ASP. NET 5 Application

Input: Yo ASPNET

Select Web application Basic (without membership and authorization), enter a name for him, for example Aspnet5web

Quickly build an application (it should actually be a template-generated process)

Then, we'll execute the following command in turn

CD Aspnet5web

DNU Restore (This command is used to load dependent packages for the project, from the NuGet Web site)

Run this project

Run the DNX Web in CMD to enable this project

By default, this site is listening on the 5000 port, so open http://localhost:5000 in the browser to see the following effect

Open a project with VS code

On the command line, enter code.

This is a familiar and unfamiliar ASP. NET MVC project, said to be familiar with, because of its basic project structure we still know better. Strange, in fact, this project with the previous MVC project is fundamentally different, it is completely based on Owin, while there are many scripting aspects of the special features. It is said that the view syntax is not the same, we find time to study it again

"Uncle Tom" wrote a series in the garden.

Http://www.cnblogs.com/TomXu/p/4496545.html

Developing an ASP. NET 5 application using vs code

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.