索引:html
目录索引git
Getting started with ASP.NET Core MVC and Visual Studiogithub
VS开发asp.net core mvc 入门web
2017-3-7 2 分钟阅读时长 express
本文内容json
1.Install Visual Studio and .NET Corec#
安装 VS 与 .NET Core浏览器
2.Create a web appmvc
建立一个 web 应用app
This tutorial will teach you the basics of building an ASP.NET Core MVC web app using Visual Studio 2017.
本教程将会教你如何使用VS2017建立一个基本的asp.net core mvc 应用程序
There are 3 versions of this tutorial:
除此以外,还有其它三个版本的教程(本身翻译~):
For the Visual Studio 2015 version of this tutorial, see the VS 2015 version of ASP.NET Core documentation in PDF format.
Install Visual Studio and .NET Core
安装 vs 与 .net core
Install Visual Studio Community 2017. Select the Community download. Skip this step if you have Visual Studio 2017 installed.
安装vs 2017 社区版。选择社区版下载。若是你已安装过能够跳过这个步骤。
Run the installer and select the following workloads:
运行这个安装包,选择下面的工做项:
须要勾选的环境一
须要勾选的环境二
Create a web app
建立一个 web 应用
From Visual Studio, select File > New > Project.
在vs中选择 File > New > Project 菜单,新建。
Complete the New Project dialog:
完成 新建项目 对话框:
在左边的窗格,点击 .net core
在中间的窗格,点击 ASP.NET Core Web Application (.NET Core)
命名项目名称为 MvcMovie
match.)
点击 OK
Complete the New ASP.NET Core Web Application (.NET Core) - MvcMovie dialog:
完成 New ASP.NET Core Web Application (.NET Core) - MvcMovie 对话框:
在版本选择下拉框中选择 ASP.NET Core 1.1 选项
点击 Web Application
保持默认的 No Authentication 选择
点击 OK
Visual Studio used a default template for the MVC project you just created. You have a working app right now by entering a project
VS使用一个默认的项目模板。在你键入项目名称与选择少许选项以后就有了一个能够正常工做的 web 应用。
name and selecting a few options. This is a simple starter 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.
点击 F5 在调试模式下启动这个程序,或者 ctrl+F5 非调试模式下运行该程序。
VS启动 iis express 用于运行你的 app 程序。注意浏览器的地址栏显示的是ip+port,而不是常见的域名。
like example.com. That's because localhost is the standard hostname for your local computer. When Visual Studio creates
这是由于 localhost 是你本机的标准主机名。当VS建立一个新的web项目,
a web project, a random port is used for the web server. In the image above, the port number is 5000. When you run the app,
一个随机的端口会被 web server 选择使用。在上图中,端口是5000. 在你本身运行这个app的时候,
you'll see a different port number.
你可能会看到一个不一样的端口。
在非调试模式下启动应用,容许你作一些代码变动,保存文件,刷新浏览器,而且
see the code changes. Many developers prefer to use non-debug mode to quickly launch the app and view changes.
查看变动。许多开发者更喜欢使用非调试模式快速启动应用并查看变动。
你能够在 Debug 菜单已调试或非调试模式启动你的app:
你能够经过点击 IIS Express 按钮启动调试程序
The default template gives you working Home, About and Contact links. The browser image above doesn't show these links.
默认的模板提供了 Home, About and Contact 三个连接与页面。上图中浏览器没有显示这些连接。
Depending on the size of your browser, you might need to click the navigation icon to show them.
由于依赖于你的浏览器宽度尺寸,你可能须要点击导航图标来显示他们。
If you were running in debug mode, tap Shift-F5 to stop debugging.
若是你在调试模式下运行,点击 Shift-F5 能够中止调试。
In the next part of this tutorial, we'll learn about MVC and start writing some code.
在接下来的教程中,咱们将会开始学习 mvc 和如何开始写一些 代码 。
蒙
2017-07-12 11:05 周三