10 minutes easy for you to know ASP. NET 5 (MVC6)

Source: Internet
Author: User

The ASP. NET 5 is almost released. I have been studying for two months. Write a simple 10-minute tutorial to get to know ASP. NET 5 today for those of you who are not in touch with ASP.

1. Installing the KVM

First, you have to open PowerShell and execute the following script:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString(‘https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.ps1‘))"

After installation, install the latest version of Kre via KVM install Latest–p.

2. Create the first application (Startup.cs and Project.json)

In ASP. 5, the two most important files are Startup.cs and Project.json.

Project.json File Description: Https://github.com/aspnet/Home/wiki/Project.json-file

Startup.cs, as its name implies, is the file that the ASP.NET5 application is looking for when it starts.

Here is the creation of our Project.json and Startup.cs files.

A. Create an empty file for Project.json:

Execute the following command under the current path:

The above command installs the most basic package that runs the ASP. As shown in the following:

After the installation is complete, you can see that the Project.json file is automatically updated:

The next thing to do is to add the command node to the Project.json file:

"commands": {    "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000"    }
project.json文件如下:

现在我们就完成了project.json文件的创建。下面创建Startup.cs文件。
Only the simple output of Hello World code.
3. Use the K Web to run the application.
This command of the web is defined in the Project.json file. It will letMicrosoft.AspNet.Server.WebListener监听5000这个端口
4.浏览页面:
If you want to learn more about ASP 5, you can refer to one of the projects I'm learning, Https://github.com/nicholaspei/OrchardNoCMS
The documentation continues to be updated to introduce the basics and features of ASP.

10 minutes easy for you to know ASP. NET 5 (MVC6)

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.