https://www.microsoft.com/net/learn/get-started-with-dotnet-tutorial#install

.NET Tutorial - Hello World in 10 minutes

Not ready to install anything? Try our in-browser tutorial.


  1. Install the .NET SDK

    To start building .NET apps you just need to download and install the .NET SDK (Software Development Kit).

    Linux Distribution

                     
    RHEL
                     
    Ubuntu 18.04
                     
    Ubuntu 17.10
                     
    Ubuntu 16.04
                     
    Ubuntu 14.04
                     
    Debian 9
                     
    Debian 8
                     
    Fedora 28
                     
    Fedora 27
                     
    CentOS / Oracle
                     
    openSUSE
                     
    SLES
         

    Add the dotnet product feed

    Before installing .NET, you'll need to register the Microsoft key, register the product repository, and install required dependencies. This only needs to be done once per machine.

    Open a command prompt and run the following commands:

    sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
    

    Install the .NET SDK

    Update the products available for installation, then install the .NET SDK.

    In your command prompt, run the following commands:

    sudo yum update
    sudo yum install dotnet-sdk-2.1
  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 myAppwhere 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.

    Download Visual Studio Code

    For full language support including smart code completion and debugging, get the C# extension for Visual Studio Code.

    Download the C# Extension

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

    Quick start: Collections

 

<亲测>centos安装 .net core 2.1的更多相关文章

  1. <亲测>CentOS中yum安装ffmpeg

    CentOS中yum安装ffmpeg 1.升级系统 sudo yum install epel-release -y sudo yum update -y sudo shutdown -r now 2 ...

  2. <亲测>CentOS 7.3下Node.js 8.6安装配置(含NPM以及PM2)

    CentOS 7.3下Node.js 8.6安装配置 2017年09月30日 14:12:02 阅读数:2245更多 个人分类: Nodejs   版权声明:本文为博主原创文章,未经博主允许不得转载. ...

  3. Centos 安装.NET Core环境

    https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install 一.概述 本篇讨论如何把项目发布到Linux环境,主要包括 ...

  4. <亲测>CentOS7yum安装PHP7.2

    如果之前已经安装我们先卸载一下 yum -y remove php* 由于linux的yum源不存在php7.x,所以我们要更改yum源 rpm -Uvh https://dl.fedoraproje ...

  5. <亲测>CentOS7 安装mysql8.0(YUM方式)

    CentOS7 安装mysql(YUM方式)   1.下载mysql源安装包 shell> wget http://dev.mysql.com/get/mysql80-community-rel ...

  6. CentOS安装.NET CORE

    Add the dotnet product feed sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc sudo ...

  7. 快速搭建CentOS+ASP.NET Core环境支持WebSocket

    环境:CentOS 7.x,.net core 2 以下.net core 2安装操作为官方方法.如果你使用Docker,那么更简单了,只需要docker pull microsoft/dotnet就 ...

  8. [转帖]CentOS 7安装并启动Google浏览器(★firecat亲测有效★)

    CentOS 7安装并启动Google浏览器(★firecat亲测有效★) https://blog.csdn.net/libaineu2004/article/details/82821405 自己 ...

  9. centos安装服务参考博客,亲测可用

    centos 安装nginx参考 日志log报错 nginx -c /etc/nginx/nginx.conf https://blog.csdn.net/weixin_41004350/articl ...

随机推荐

  1. 【leetcode】53-MaximumSubarray

    problem MaximumSubarray code class Solution { public: int maxSubArray(vector<int>& nums) { ...

  2. Python 模块管理1

    Python 模块管理   导入新的模块 创建一个 calculate.py 文件 print('ok') def add(x,y): return x + y def sub(x,y): retur ...

  3. Windows 清理磁盘

    ====手动清理C盘(开始\运行\cleanmgr,选择C盘...)或者如下右键C盘,选择属性,点击通用页签下方[磁盘清理]按钮.磁盘清理界面,中间部分可以选择要清理的项目,可以全选.然后点击下方的清 ...

  4. php基础-1

    php规范 php文件以<?php开头,以?>结尾. php可以和html代码混写,若当前文件为纯php代码 ,则不用写php结尾 php的一行代码以";"(分号)结尾 ...

  5. 【次小生成树】【Kruskal】【prim】【转】

    原博客出处:https://blog.csdn.net/yasola/article/details/74276255 通常次小生成树是使用Prim算法进行实现的,因为可以在Prim算法松弛的同时求得 ...

  6. hotel管理

    PS:这个界面

  7. rpm使用

    查找某个rpm包是否安装 rpm -qa|grep 包名 #我们再次安装是会提示和那个包冲突,直接复制那个报名过来就可 安装rpm包 rpm -ivh 报名

  8. 系统限制和选项limit(一)

    从shell中获取系统限制和选项 终端输入getconf value [pathname] [root@bogon code]# getconf ARG_MAX 2097152 [root@bogon ...

  9. datetime学习

    四.datetime类 (一).datetime类的数据构成 datetime类其实是可以看做是date类和time类的合体,其大部分的方法和属性都继承于这二个类,相关的操作方法请参阅,本文上面关于二 ...

  10. asyn proposals

    Objective: