ASP.NET Core 不同操作系统环境安装之Hello World 教程
Official Website:https://www.microsoft.com/net/learn/get-started-with-dotnet-tutorial#install
Windows
Install the .NET SDK
To start building .NET apps you just need to download and install the .NET SDK (Software Development Kit).
Create your app
Open a new command prompt and run the following commands:
dotnet new console -o myApp
cd myAppThe
dotnetcommand creates anewapplication of typeconsolefor you. The-oparameter creates a directory namedmyAppwhere your app is stored, and populates it with the required files. Thecd myAppcommand puts you into the newly created app directory.The main file in the
myAppfolder isProgram.cs. By default, it already contains the necessary code to write "Hello World!" to the Console.using System; namespace myApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}Run your app
In your command prompt, run the following command:
dotnet runCongratulations, you've built and run your first .NET app!
Get an editor
Visual Studio is a fully-featured integrated development environment (IDE) for developing .NET apps on Windows.
Keep learning
Now that you've got the basics, you can keep learning with the .NET Quick Starts. In the first Quick Start you'll learn about collections.
Linux
Install the .NET SDK
To start building .NET apps you just need to download and install the .NET SDK (Software Development Kit).
Linux Distribution
Enable .NET channel
In order to install .NET Core from Red Hat on RHEL, you first need to register using the Red Hat Subscription Manager. If this has not been done on your system, or if you are unsure, see the Red Hat Getting Started Guide.
Install .NET SDK
After registering with the Subscription Manager and enabling the .NET Core channel, you are ready to install and enable the .NET SDK.
In your command prompt, run the following commands:
yum install rh-dotnet21 -y
scl enable rh-dotnet21 bashCreate your app
Open a new command prompt and run the following commands:
dotnet new console -o myApp
cd myAppThe
dotnetcommand creates anewapplication of typeconsolefor you. The-oparameter creates a directory namedmyAppwhere your app is stored, and populates it with the required files. Thecd myAppcommand puts you into the newly created app directory.The main file in the
myAppfolder isProgram.cs. By default, it already contains the necessary code to write "Hello World!" to the Console.using System; namespace myApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}Run your app
In your command prompt, run the following command:
dotnet runCongratulations, you've built and run your first .NET app!
Get an editor
Visual Studio Code is a free, cross-platform code editor with support for .NET.
For full language support including smart code completion and debugging, get the C# extension for Visual Studio Code.
Keep learning
Now that you've got the basics, you can keep learning with the .NET Quick Starts. In the first Quick Start you'll learn about collections.
MacOS
Install the .NET SDK
To start building .NET apps you just need to download and install the .NET SDK (Software Development Kit).
Create your app
Open a new command prompt and run the following commands:
dotnet new console -o myApp
cd myAppThe
dotnetcommand creates anewapplication of typeconsolefor you. The-oparameter creates a directory namedmyAppwhere your app is stored, and populates it with the required files. Thecd myAppcommand puts you into the newly created app directory.The main file in the
myAppfolder isProgram.cs. By default, it already contains the necessary code to write "Hello World!" to the Console.using System; namespace myApp
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}Run your app
In your command prompt, run the following command:
dotnet runCongratulations, you've built and run your first .NET app!
Get an editor
Visual Studio Code is a free, cross-platform code editor with support for .NET.
For full language support including smart code completion and debugging, get the C# extension for Visual Studio Code.
Keep learning
Now that you've got the basics, you can keep learning with the .NET Quick Starts. In the first Quick Start you'll learn about collections.
ASP.NET Core 不同操作系统环境安装之Hello World 教程的更多相关文章
- asp.net core webapi 似乎未安装在 IIS 中承载 .NET Core 项目所需的 AspNetCoreModule。请尝试修复 Visual Studio 以纠正该问题。
安装 DotNetCore.1.1.0-WindowsHosting 后,提示如题错误. 解决办法: ASP.NET Core 应用程序运行,可以选择 IIS Express 也可以选择 自己运行 , ...
- Asp.Net Core Cookie使用,Asp.net Core Cookie操作失效
注:本文主要介绍Asp.net Core 3.0后增加cookie代理功能. 默认是增加了的. 默认增加的这个有些问题所在, 1.原来设置cookie方式将不可用,需要按照代理方式设置 2.对于ses ...
- 【翻译】使用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 ...
- 使用Jexus 5.8.2在Centos下部署运行Asp.net core
这里安装的Jexus不是独立版本,所以需要先安装Mono 系统版本:Cenos7,Mono版本:5.0.1 Stable (5.0.1.1) Mono官方doc:http://www.mono-p ...
- ASP.NET Core & Docker 实战经验分享
一.前言 最近一直在研究和实践ASP.NET Core.Docker.持续集成.在ASP.NET Core 和 Dcoker结合下遇到了一些坑,在此记录和分享,希望对大家有一些帮助. 二.中间镜像 我 ...
- 在 Azure 上部署 Asp.NET Core Web App
在云计算大行其道的时代,当你要部署一个网站时第一选择肯定是各式各样的云端服务.那么究竟使用什么样的云端服务才能够以最快捷的方式部署一个 ASP.NET Core的网站呢?Azure 的 Web App ...
- 在 Visual Studio 中部署 ASP.NET Core 应用
另一篇:在 Docker 中手工部署 ASP.NET Core 应用 操作步骤 1. 安装 Docker For Windows(安装之前 Windows 需要 开启 Hyper-V 虚拟机功能 ) ...
- 在 Docker 中手工部署 ASP.NET Core 应用
另一篇:在 Visual Studio 中部署 ASP.NET Core 应用 操作步骤 1. 安装 Docker For Windows(安装之前 Windows 需要开启 Hyper-V 虚拟机 ...
- 从零实操基于WSL2 Docker部署Asp.Net Core项目
前言 平日在公司里都是基于阿里Teambition中的飞流进行Docker部署Api项目或服务,已经习惯了那一套成熟的操作流程,开发和部署确实快捷方便,但是还没在自己的电脑上进行操作过,特别是Wind ...
随机推荐
- spring /spring boot中mock
1 Mockito简介 1.1 Mockito是什么 Mockito是一个简单的流行的Mock框架.它允许你创建和配置mock对象.使用Mockito可以明显的简化对外部依赖的测试类的开发.一般使 ...
- Bossies 2015: The Best of Open Source Software Awards
InfoWorld editors and contributors pick the top open source software for data centers, clouds, devel ...
- 1418 This function has none of DETERMINISTIC,NO SQL,or R
标签: [err]1418 函数创建报错 分类: 菜鸟DBA之MySQL --------------------------------------------------------------- ...
- Hadoop2.7.4 在 Windows 10(64位) 详细配置
网上查询资料,实际配置后整理记录. 一.下载安装配置 1.8.0 以上版本 java 环境 完成后,使用 java -version 命令查看是否成功. 二.下载 hadoop-2.7.4.tar.g ...
- JavaScript 之 解码类似eval(function(p,a,c,k,e,d){}))的JavaScript代码
这里以解码百度访问统计代码构造函数为示例: 以下为要统计JavaScript源码:红色加粗部分将是要修改的地方. eval(function(p,a,c,k,e,d){e=function(c){re ...
- Error 之 只能在执行Render() 的过程中调用 RegisterForEventValidation;
在实现"将GridView中的数据导出到Excel中"的时候出现了如下错误: 用户代码未处理 InvalidOperationException 只能在执行 Render() 的过 ...
- google protocol buffer 简介 版本 安装 使用 实例
一.简介 protocolbuffer(以下简称PB)是google 的一种数据交换的格式,它独立于语言,独立于平台.google 提供了三种语言的实现:java.c++ 和 python,每一种实现 ...
- JAVA i++于++i的区别
大家看一下下面一个程序: 一.问题说明 Test.java public class Test { public static void main(String[] args) { int i = 1 ...
- js跨域解决方式
什么是跨域? 概念:仅仅要协议.域名.port有不论什么一个不同,都被当作是不同的域.(所谓同源是指,域名.协议,port同样.),对于port和协议的不同,仅仅能通过后台来解决. URL 说明 是否 ...
- NGUI 降低drawcall
前置说明一: Unity中的drawcall定义: 每次引擎准备数据并通知GPU的过程称为一次Draw Call. Unity(或者说基本全部图形引擎)生成一帧画面的处理过程大致能够这样简化描写叙述: ...