【翻译】使用Visual Studio创建Asp.Net Core MVC (一)
This tutorial will teach you the basics of building an ASP.NET Core MVC web app using Visual Studio 2015.
在这个范例里,我们将使用Visual Studio 2015创建基本的Asp.Net Core MVC网站。
安装Visual Studio和.Net Core
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后默认安装,如果你已经安装可以跳过这步。
- Visual Studio 2015 Home page installer(Visual Studio 2015安装页)
创建一个Web应用
From the Visual Studio Start page, tap New Project.
在Visual Studio 起始页面,点击New Project
Alternatively, you can use the menus to create a new project. Tap File > New > Project.
你也可以通过菜单创建新项目。点击File > New Project
Complete the New Project dialog:
在New Project对话框完成以下操作:
- In the left pane, tap .NET Core
- 在左侧面板,选择.Net Core
- In the center pane, tap ASP.NET Core Web Application (.NET Core)
- 在中间面板,选择Asp.Net Core web Application(.Net Core)
- Name the project "MvcMovie" (It's important to name the project "MvcMovie" so when you copy code, the namespace will match.)
- 项目取名:MvcMove(当你复制代码时,这个项目名称很重要,它跟命名空间相匹配)
- Tap OK
- 点击OK

Complete the New ASP.NET Core Web Application - MvcMovie dialog:
在New Asp.Net Core Web Application –MvcMovie对话框完成以下操作:
- Tap Web Application
- 点击Web Application
- Clear Host in the cloud
- 不勾选Host in the cloud
- Tap OK.
- 点击OK

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模式运行。

- Visual Studio starts IIS Express and runs your app. Notice that the address bar shows
localhost:port#and not something likeexample.com. That's becauselocalhostalways 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. - Visual Studio将开启IIS Express运行你的应用。注意浏览器地址栏显示的是localhost:端口号而不是example.com,这是因为这种情况下运行刚创建的应用,localhost总是指向自己的电脑。当Visual Studio创建了一个web项目后,它将为web服务器随机一个端口号。以下图片上,显示的是1234端口,当你自己运行的时候,你看到的将是一个不同的端口号。
- Launching the app with Ctrl+F5 (non-debug mode) allows you to make code changes, save the file, refresh the browser, and see the code changes. Many developers prefer to use non-debug mode to quickly launch the app and view changes.
- 使用Ctrl+F5(非Debug模式)运行应用,允许你在更改代码,保存文件后,使用刷新页面就能看到你的改变。许多开发者都喜欢用non-debug模式快速运行应用和查看更改。
- You can launch the app in debug or non-debug mode from the Debug menu item:
- 你可以通过Debug菜单运行Debug和non-debug模式:

- You can debug the app by tapping the IIS Express button
- 你也可以点击IIS Express按钮运行Debug模式

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
【翻译】使用Visual Studio创建Asp.Net Core MVC (一)的更多相关文章
- ASP.NET Core 中文文档 第二章 指南(2)用 Visual Studio 和 ASP.NET Core MVC 创建首个 Web API
原文:Building Your First Web API with ASP.NET Core MVC and Visual Studio 作者:Mike Wasson 和 Rick Anderso ...
- Working with Data » 使用Visual Studio开发ASP.NET Core MVC and Entity Framework Core初学者教程
原文地址:https://docs.asp.net/en/latest/data/ef-mvc/intro.html The Contoso University sample web applica ...
- Visual Studio 2017 ASP.NET Core开发
Visual Studio 2017 ASP.NET Core开发,Visual Studio 2017 已经内置ASP.NET Core 开发工具. 在选择.NET Core 功能安装以后就可以进行 ...
- 创建ASP.NET Core MVC应用程序(1)-添加Controller和View
创建ASP.NET Core MVC应用程序(1)-添加Controller和View 参考文档:Getting started with ASP.NET Core MVC and Visual St ...
- 创建ASP.NET Core MVC应用程序(6)-添加验证
创建ASP.NET Core MVC应用程序(6)-添加验证 DRY原则 DRY("Don't Repeat Yourself")是MVC的设计原则之一.ASP.NET MVC鼓励 ...
- 创建ASP.NET Core MVC应用程序(5)-添加查询功能 & 新字段
创建ASP.NET Core MVC应用程序(5)-添加查询功能 & 新字段 添加查询功能 本文将实现通过Name查询用户信息. 首先更新GetAll方法以启用查询: public async ...
- 创建ASP.NET Core MVC应用程序(4)-添加CRUD动作方法和视图
创建ASP.NET Core MVC应用程序(4)-添加CRUD动作方法和视图 创建CRUD动作方法及视图 参照VS自带的基架(Scaffold)系统-MVC Controller with view ...
- 创建ASP.NET Core MVC应用程序(3)-基于Entity Framework Core(Code First)创建MySQL数据库表
创建ASP.NET Core MVC应用程序(3)-基于Entity Framework Core(Code First)创建MySQL数据库表 创建数据模型类(POCO类) 在Models文件夹下添 ...
- 创建ASP.NET Core MVC应用程序(2)-利用MySQL Connector NET连接到MySQL
创建ASP.NET Core MVC应用程序(2)-利用MySQL Connector NET连接到MySQL 用惯.NET的研发人员都习惯性地使用SQLServer作为数据库.然而.NET Core ...
随机推荐
- myeclipse连接hadoop集群编程及问题解决
原以为搭建一个本地编程测试hadoop程序的环境很简单,没想到还是做得焦头烂额,在此分享步骤和遇到的问题,希望大家顺利. 一.要实现连接hadoop集群并能够编码的目的需要做如下准备: 1.远程had ...
- poj 1837 Balance 动态规划 (经典好题,很锻炼思维)
题目大意:给你一个天平,并给出m个刻度,n个砝码,刻度的绝对值代表距离平衡点的位置,并给出每个砝码的重量.达到平衡状态的方法有几种. 题目思路:首先我们先要明确dp数组的作用,dp[i][j]中,i为 ...
- Mybatis的<where><foreach><set>等标签详解
sql语句where条件中,需要一些安全判断,例如按性别检索,如果传入的参数是空的,此时查询出的结果很可能是空的,也许我们需要参数为空 时,是查出全部的信息.这是我们可以使用动态sql,增加一个判断, ...
- Python3基础 定义有参数有返回值函数 对传入的参数加1
镇场诗: 诚听如来语,顿舍世间名与利.愿做地藏徒,广演是经阎浮提. 愿尽吾所学,成就一良心博客.愿诸后来人,重现智慧清净体.-------------------------------------- ...
- markdown表格
markdown制作表格 一. 使用原生html表格标签制作 <table> <tr> <td>表头</td> </tr> <tr&g ...
- OpenStack - liberty CentOS 7
OpenStack私有云部署 Controller Node: em1(10.6.17.11),em2() Computer Node: em1(10.6.17.12),e ...
- python函数的参数传递问题---传值还是传引用?
摘要:在python中,strings, tuples, 和numbers是不可更改的对象,而list,dict等则是可以修改的对象.不可更改对象的传递属于传值,可更改对象属于传引用.想要在函数中传递 ...
- webservice-概念性学习(一)
以下是本人原创,如若转载和使用请注明转载地址.本博客信息切勿用于商业,可以个人使用,若喜欢我的博客,请关注我,谢谢!博客地址 学习webservice之前呢,我想说我们先学习以下的知识,对你以后的学习 ...
- Handler和Message以及Looper之间的三角关系
说到Handler想必大家都经常用到,在非UI线程更新UI那可是利器,用起来也非常容易上手 从使用上来说,我们只需要关注sendMessage和handleMessage即可 所以我们先从Handle ...
- mysql show命令
MySQL中有很多的基本命令,show命令也是其中之一,在很多使用者中对show命令的使用还容易产生混淆,本文汇集了show命令的众多用法. 1. show tables或show tables fr ...