Practice. Net Core's first Hello World in a Linux environment

Source: Internet
Author: User
Tags dotnet

Basic environment and related software preparation

1, CentOS7.1 64-bit system (or other CentOS version of the 64-bit system)

2, WinSCP software (mainly to facilitate the management and editing of Linux system files)

3, Xshell software (Linux terminal in Windows environment)

4,. Netcore installation Reference URL, Https://www.microsoft.com/net/core#centos

5,. Netcore,https://www.microsoft.com/net/download#core

6. Quick Start example, https://docs.asp.net/en/latest/getting-started.html

Operation Steps

1, virtual machine installed CentOS7.1 system, and debugging a good network

2. WINSCP and Xshell software install and configure the connection CentOS7.1

Everything is ready, and the show starts right away ....

1.. Net Core Download and installation

sudo yum install libunwind Libicu

Curl-ssl-o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=809131

sudo mkdir-p/opt/dotnet && sudo tar zxf dotnet.tar.gz-c/opt/dotnet

sudo ln-s/opt/dotnet/dotnet/usr/local/bin

Command Simple explanation

1) Install the necessary support packages

2) Download the. Net Core installation package (a bit large and need to wait patiently ...). )

3) Unzip the installation package and copy the files to the/opt/dotnet directory

4) Create a soft link file named dotnet in the/usr/local/bin directory to point to the/opt/dotnet/dotnet file, and the soft link is understood as a shortcut

2. Create a. Net Core application

mkdir Hwapp

CD Hwapp

dotnet New

Command Simple explanation

1) Create a directory named Hwapp

2) Enter the directory

3) Execute the dotnet new command to create a. Net Core project

3. Restore dependent libraries & Run programs

dotnet Restore

Dotnet Run

Command explanation
1) Restore dependent library files according to the Project.json configuration file in the Hwapp project (in fact NuGet downloads dependent files from the remote server)

2) Run the Hwapp program (the Default Access address is: http://localhost:5000)

#以上操作步骤参考, Https://www.microsoft.com/net/core#centos

Finally put a few of their own practice map

Practice. Net Core's first Hello World in a Linux environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.