关键词:
索引:
Getting Started
入门指南
Meng.Net 自译
1. Install .NET Core
到官网安装 .NET Core
2. Create a new .NET Core project:
用cmd命令窗口 ,创建一个新的 工程
mkdir aspnetcoreapp
新建目录 aspnetcoreapp
cd aspnetcoreapp
移动到目录 aspnetcoreapp
dotnet new
在目录中新建工程
3. Update the project.json file to add the Kestrel HTTP server package as a dependency:
更新 project.json 文件,添加 Microsoft.AspNetCore.Server.Kestrel 依赖包
1 { 2 "version": "1.0.0-*", 3 "buildOptions": { 4 "debugType": "portable", 5 "emitEntryPoint": true 6 }, 7 "dependencies": {}, 8 "frameworks": { 9 "netcoreapp1.0": { 10 "dependencies": { 11 "Microsoft.NETCore.App": { 12 "type": "platform", 13 "version": "1.0.0" 14 }, 15 "Microsoft.AspNetCore.Server.Kestrel": "1.0.0" 16 }, 17 "imports": "dnxcore50" 18 } 19 } 20 }
4. Restore the packages:
使用 nuget 更新依赖文件
dotnet restore
更新依赖文件命令
5. Add a Startup.cs file that defines the request handling logic:
添加 Startup.cs 文件,定义请求处理逻辑
1 using System; 2 using Microsoft.AspNetCore.Builder; 3 using Microsoft.AspNetCore.Hosting; 4 using Microsoft.AspNetCore.Http; 5 6 namespace aspnetcoreapp 7 { 8 public class Startup 9 { 10 public void Configure(IApplicationBuilder app) 11 { 12 app.Run(context => 13 { 14 return context.Response.WriteAsync("Hello from ASP.NET Core!"); 15 }); 16 } 17 } 18 }
6. Update the code in Program.cs to setup and start the Web host:
更新 Program.cs 文件,设置并启动 Web host :
1 using System; 2 using Microsoft.AspNetCore.Hosting; 3 4 namespace aspnetcoreapp 5 { 6 public class Program 7 { 8 public static void Main(string[] args) 9 { 10 var host = new WebHostBuilder() 11 .UseKestrel() 12 .UseStartup<Startup>() 13 .Build(); 14 15 host.Run(); 16 } 17 } 18 }
7. Run the app (the dotnet run command will build the app when it’s out of date):
运行程序
dotnet run
运行程序命令
8. Browse to http://localhost:5000:
在浏览器中浏览
Next steps
- Building your first ASP.NET Core MVC app with Visual Studio
- Your First ASP.NET Core Application on a Mac Using Visual Studio Code
- Building Your First Web API with ASP.NET Core MVC and Visual Studio
- Fundamentals
蒙
2016-09-27 11:50 周二
cassandra入门指南--安装及配置
Cassandra入门指南--安装及配置cassandra安装配置 查看详情
go语言入门指南零基础入门go语言|golang入门指南(代码片段)
文章目录写在前面全部练习项目都在github这个仓库中`https://github.com/CocaineCong/Golang-Learning`1.【第一轮】基础部分1.1教程1.2练习2.【第二轮】网络爬虫2.1教程2.2mod管理第三方包2.3git机制3.【第三轮】备忘录4.【第四轮】商城or视... 查看详情
go语言入门指南零基础入门go语言|golang入门指南(代码片段)
文章目录写在前面全部练习项目都在github这个仓库中`https://github.com/CocaineCong/Golang-Learning`1.【第一轮】基础部分1.1教程1.2练习2.【第二轮】网络爬虫2.1教程2.2mod管理第三方包2.3git机制3.【第三轮】备忘录4.【第四轮】商城or视... 查看详情
opencv入门指南(转载)
...18网上的总结的一些用openncv的库来做的事:下面列出OpenCV入门指南系列目录,以方便大家查看:文章链接:http://blog.csdn.net/morewindows/article/details/8426318下面这些链接在文章末尾:1.《【OpenCV入门指南】第 查看详情
c#入门指南
https://docs.microsoft.com/zh-cn/dotnet/csharp/tour-of-csharp/ 查看详情
flutter之beamer路由入门指南
beamer路由入门指南前言使用方法1、路由配置方式1路由配置方式2路由跳转测试现象前言Beamer是一个很好用的路由组件,本文以beamer1.5.0版本进行说明,前面博主也介绍了其他路由组件Flutter实战之go_router路由组件入门指南、Flutter... 查看详情
flutter之beamer路由入门指南
beamer路由入门指南前言使用方法1、路由配置方式1路由配置方式2路由跳转测试现象前言Beamer是一个很好用的路由组件,本文以beamer1.5.0版本进行说明,前面博主也介绍了其他路由组件Flutter实战之go_router路由组件入门指南、Flutter... 查看详情
elklogstashgrok入门指南
ABeginner’sGuidetoLogstashGrok(https://logz.io/blog/logstash-grok/)Theabilitytoefficientlyanalyzeandquerythedatabeingshippedintothe ELKStack dependsontheinformationbeingreadable.This 查看详情
ctf入门指南
ctf入门指南 如何入门?如何组队?capturetheflag夺旗比赛类型:Web密码学pwn程序的逻辑分析,漏洞利用windows、linux、小型机等misc杂项,隐写,数据还原,脑洞、社会工程、与信息安全相关的大数据reverse逆向windows、linux类ppc编... 查看详情
ctf入门指南
转自http://www.cnblogs.com/christychang/p/6032532.htmlctf入门指南如何入门?如何组队?capturetheflag夺旗比赛类型:Web密码学pwn程序的逻辑分析,漏洞利用windows、linux、小型机等misc杂项,隐写,数据还原,脑洞、社会工程、与信息安全相关... 查看详情
ctf入门指南
ctf入门指南如何入门?如何组队?capturetheflag夺旗比赛类型:Web密码学pwn程序的逻辑分析,漏洞利用windows、linux、小型机等misc杂项,隐写,数据还原,脑洞、社会工程、与信息安全相关的大数据reverse逆向windows、linux类ppc编程类... 查看详情
ctf入门指南
ctf入门指南如何入门?如何组队?capturetheflag夺旗比赛类型:Web密码学pwn程序的逻辑分析,漏洞利用windows、linux、小型机等misc杂项,隐写,数据还原,脑洞、社会工程、与信息安全相关的大数据reverse逆向windows、linux类ppc编程类... 查看详情
opencv入门指南
...,文章最后还介绍了一个使用OpenCV的简单小例子。《OpenCV入门指南》系列文章地址:http://blog.csdn.net/morewindows/article/category/1291764一.OpenCV的下载可以到http://www.opencv.org.cn 查看详情
docker入门指南
地址:docker入门指南更换国内镜像源dockerstore地址默认是在国外,下载速度很慢,自行更换国内docker加速地址。名词解释image:镜像containers:容器docker-machine:docker虚拟主机dockerstore:docker存储云术语Image和ContainerImage可以理解为一个系... 查看详情
[转]visualvm入门指南
...可以方便、快捷地查看多个Java应用程序的相关信息。本入门指南应当对您快速设置并运行VisualVM有所帮助。本指南将演示如何安装VisualVM,以及如何通过安装VisualVM更新中心提供的插件向该工具添加功能。本指南还将介绍如何启... 查看详情
opencv入门指南第二篇缩放图像(代码片段)
【OpenCV入门指南】第二篇缩放图像上一篇《【OpenCV入门指南】第一篇安装OpenCV》讲解了如何在VS2008下安装和配置OpenCV,本篇将介绍使用OpenCV来缩放图片。首先介绍几个关键函数——cvResize和cvCreateImage《OpenCV入门指南》系列文章地... 查看详情
好书推荐typescript的入门指南|《typescript入门与实战》
目录一、TypeScript的入门指南二、书籍信息三、适合人群四、相关推荐一、TypeScript的入门指南你好,我是小雨青年,一名程序员。今天为你推荐的书籍是《TypeScript入门与实战》。本书包括两部分:JavaScript语言编程ÿ... 查看详情
gulp使用1-入门指南
入门指南1.全局安装gulp:$npminstall--globalgulp或使用cnpm2.作为项目的开发依赖(devDependencies)安装:$npminstall--save-devgulp3.在项目根目录下创建一个名为 gulpfile.js 的文件:vargulp=require(‘gulp‘);gulp.task(‘default‘,function(){// 查看详情