This tutorial will teach you the basics of building an ASP.NET Core MVC web app using Visual Studio 2015.web
在這個範例裏,咱們將使用Visual Studio 2015建立基本的Asp.Net Core MVC網站。express
Install Visual Studio Community 2015. Select the Community download and the default installation. Skip this step if you have Visual Studio 2015 installed.瀏覽器
安裝Visual Studio Community 2015。下載Community後默認安裝,若是你已經安裝能夠跳過這步。 服務器
Install .NET Core + Visual Studio toolingmvc
From the Visual Studio Start page, tap New Project. dom
在Visual Studio 起始頁面,點擊New Project visual-studio
Alternatively, you can use the menus to create a new project. Tap File > New > Project. 網站
你也能夠經過菜單建立新項目。點擊File > New Project ui
Complete the New Project dialog:
在New Project對話框完成如下操做:
Complete the New ASP.NET Core Web Application - MvcMovie dialog:
在New Asp.Net Core Web Application –MvcMovie對話框完成如下操做:
Visual Studio used a default template for the MVC project you just created, so you have a working app right now by entering a project name and selecting a few options. This is a simple "Hello World!" project, and it's a good place to start,Tap F5 to run the app in debug mode or Ctrl-F5 in non-debug mode.
Visual Studio會根據默認模板建立MVC項目,你只要輸入一個項目名和選擇幾個選項就能建立。這是一個Hello World的項目,一個好的開始!點擊F5debug模式應用或者Ctrl+F5非Debug模式運行。
localhost:port#
and not something like example.com
. That's because localhost
always points to your own local computer, which in this case is running the app you just created. When Visual Studio creates a web project, a random port is used for the web server. In the image above, the port number is 1234. When you run the app, you'll see a different port number. The default template gives you working Home, About and Contact links. The browser image above doesn't show these links. Depending on the size of your browser, you might need to click the navigation icon to show them.
默認模板有HOME,About和Contact三個連接。下圖由於瀏覽器問題你看不到這幾個連接,你能夠經過點擊導航圖標顯示。
If you were running in debug mode, tap Shift-F5 to stop debugging.
若是你運行在Debug模式下,Shift+F5中止Debug。
In the next part of this tutorial, we'll learn about MVC and start writing some code.
在這個範例的下一章節,咱們將如何編寫MVC代碼。
https://docs.microsoft.com/zh-cn/aspnet/core/tutorials/first-mvc-app/start-mvc