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).

 
  1. Create your app

    Open a new command prompt and run the following commands:

    dotnet new console -o myApp
    cd myApp

    The dotnet command creates a new application of type console for you. The -o parameter creates a directory named myApp where your app is stored, and populates it with the required files. The cd myApp command puts you into the newly created app directory.

    The main file in the myApp folder is Program.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!");
    }
    }
    }
  2. Run your app

    In your command prompt, run the following command:

    dotnet run

    Congratulations, you've built and run your first .NET app!

  3. Get an editor

    Visual Studio is a fully-featured integrated development environment (IDE) for developing .NET apps on Windows.

  4. 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

 
    1. 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 bash
    2. Create your app

      Open a new command prompt and run the following commands:

      dotnet new console -o myApp
      cd myApp

      The dotnet command creates a new application of type console for you. The -o parameter creates a directory named myApp where your app is stored, and populates it with the required files. The cd myApp command puts you into the newly created app directory.

      The main file in the myApp folder is Program.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!");
      }
      }
      }
    3. Run your app

      In your command prompt, run the following command:

      dotnet run

      Congratulations, you've built and run your first .NET app!

    4. 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.

  1. 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).

 
    1. Create your app

      Open a new command prompt and run the following commands:

      dotnet new console -o myApp
      cd myApp

      The dotnet command creates a new application of type console for you. The -o parameter creates a directory named myApp where your app is stored, and populates it with the required files. The cd myApp command puts you into the newly created app directory.

      The main file in the myApp folder is Program.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!");
      }
      }
      }
    2. Run your app

      In your command prompt, run the following command:

      dotnet run

      Congratulations, you've built and run your first .NET app!

    3. 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.

  1. 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 教程的更多相关文章

  1. asp.net core webapi 似乎未安装在 IIS 中承载 .NET Core 项目所需的 AspNetCoreModule。请尝试修复 Visual Studio 以纠正该问题。

    安装 DotNetCore.1.1.0-WindowsHosting 后,提示如题错误. 解决办法: ASP.NET Core 应用程序运行,可以选择 IIS Express 也可以选择 自己运行 , ...

  2. Asp.Net Core Cookie使用,Asp.net Core Cookie操作失效

    注:本文主要介绍Asp.net Core 3.0后增加cookie代理功能. 默认是增加了的. 默认增加的这个有些问题所在, 1.原来设置cookie方式将不可用,需要按照代理方式设置 2.对于ses ...

  3. 【翻译】使用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 ...

  4. 使用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 ...

  5. ASP.NET Core & Docker 实战经验分享

    一.前言 最近一直在研究和实践ASP.NET Core.Docker.持续集成.在ASP.NET Core 和 Dcoker结合下遇到了一些坑,在此记录和分享,希望对大家有一些帮助. 二.中间镜像 我 ...

  6. 在 Azure 上部署 Asp.NET Core Web App

    在云计算大行其道的时代,当你要部署一个网站时第一选择肯定是各式各样的云端服务.那么究竟使用什么样的云端服务才能够以最快捷的方式部署一个 ASP.NET Core的网站呢?Azure 的 Web App ...

  7. 在 Visual Studio 中部署 ASP.NET Core 应用

    另一篇:在 Docker 中手工部署 ASP.NET Core 应用 操作步骤 1. 安装 Docker For Windows(安装之前 Windows 需要 开启 Hyper-V 虚拟机功能 ) ...

  8. 在 Docker 中手工部署 ASP.NET Core 应用

    另一篇:在 Visual Studio 中部署 ASP.NET Core 应用  操作步骤 1. 安装 Docker For Windows(安装之前 Windows 需要开启 Hyper-V 虚拟机 ...

  9. 从零实操基于WSL2 Docker部署Asp.Net Core项目

    前言 平日在公司里都是基于阿里Teambition中的飞流进行Docker部署Api项目或服务,已经习惯了那一套成熟的操作流程,开发和部署确实快捷方便,但是还没在自己的电脑上进行操作过,特别是Wind ...

随机推荐

  1. (纪录片)鸟瞰中国 China from Above

    简介: 类型: 纪录片官方网站: natgeotv.com/uk/china-from-above制片国家/地区: 美国语言: 英语集数: 2单集片长: 44分钟IMDb链接: tt4872012 主 ...

  2. [信息检索] 第一讲 布尔检索Boolean Retrieval

    第一讲 布尔检索Boolean Retrieval 主要内容: 信息检索概述 倒排记录表 布尔查询处理 一.信息检索概述 什么是信息检索? Information Retrieval (IR) is ...

  3. Skyline开发2-第一个程序

    来试试Skyline的Hello World.使用的工具是VS2017+Skyline6.5 加载组件 在工具箱右键新建skyline选项卡,在skyline选项卡上右键选择项,在弹出的"选 ...

  4. jQuery开发技巧

    jQuery 事件 - submit() 方法 $("form").submit(function(e){}); 当提交表单时,会发生 submit 事件. 该事件只适用于表单元素 ...

  5. 使用docker api

    前提: 系统centos 7 docker version 1.10.3 使用systemd启动docker 访问方式: 修改/usr/lib/systemd/system/docker.servic ...

  6. intel vt

    EPT和VPID技术是内存虚拟化技术, 是页表扩充技术Extended Page Table (EPT) 的缩写, 是VT-x技术的一部分. 内存虚拟化的主要任务是实现地址空间的虚拟化,内存虚拟化是通 ...

  7. Spark的运行模式(2)--Yarn-Cluster和Yarn-Client

    3. Yarn-Cluster Yarn是一种统一资源管理机制,可以在上面运行多种计算框架.Spark on Yarn模式分为两种:Yarn-Cluster和Yarn-Client,前者Driver运 ...

  8. jquery vue 框架区别

    1.数据和视图分离,解耦 2.以数据驱动视图,只关心数据变化,DOM操作被封装

  9. 《跟孩子学Python》

    1:Python对象之间的赋值是内容赋值而不是引用赋值 a = ["aaa","bbb","ccc"] b = a print a prin ...

  10. Eclipse项目修改没有同步到编译的问题

    有两个原因: 1:项目有错,不能正常编译:查看是否有Jar包冲突.JDK版本问题等: 2:编译输出目录配置错误: Maven项目会修改项目编译时的输出路径到target文件夹,但是我们用Myelips ...