博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ASP.NET Core 不同操作系统环境安装之Hello World 教程
阅读量:5329 次
发布时间:2019-06-14

本文共 4249 字,大约阅读时间需要 14 分钟。

Official Website:

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

      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 -yscl enable rh-dotnet21 bash
    2. Create your app

      Open a new command prompt and run the following commands:

      dotnet new console -o myAppcd 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 myAppcd 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.

 

转载于:https://www.cnblogs.com/boonya/p/9530843.html

你可能感兴趣的文章
Swift和OC混编
查看>>
深度学习文献阅读笔记(6)
查看>>
Android轻量级的开源缓存框架ASimpleCache
查看>>
他山之石:加载图片的一个小问题
查看>>
IOS 多个UIImageView 加载高清大图时内存管理
查看>>
shell - 常识
查看>>
[PHP] excel 的导入导出
查看>>
圆角进度条,带数字居中显示的圆角进度条
查看>>
docker-containerd 启动流程分析
查看>>
SDL(01-10)
查看>>
2017马上过去了
查看>>
03: 通讯录管理
查看>>
Kettle数据源连接配置
查看>>
[na]pc加入域认证细节
查看>>
网络爬虫基本原理(一)
查看>>
python学习Day6 元组、字典、集合set三类数据用法、深浅拷贝
查看>>
Quartz.NET实现作业调度
查看>>
[转]abstract 抽象类的概念和使用
查看>>
JAX-WS发布WebService
查看>>
ES6 块级作用域
查看>>