Detailed Explanation of the Steps of Deploying. net core Environment under Linux

  • 2021-09-20 20:00:38
  • OfStack

Note: Installation on Linux. net core environment requires 64-bit system

The installation and deployment are as follows:

1. Add dotnet source to apt-get

Ubuntu 14.04 / Linux Mint 17


sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
sudo apt-get update

Ubuntu 16.04


sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
sudo apt-get update

Ubuntu 16.10


sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ yakkety main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
sudo apt-get update

2. Installation. NET Core SDK

The address of the latest version of SDK is as follows:

Official address: https://www.microsoft.com/net/download/linux

Local download: https://www.ofstack.com/softs/472366. html


sudo apt-get install dotnet-dev-1.0.1

3. Generate sample code

After installing SDK, generate 1 sample code to see if the installation was successful


dotnet new console -o hwapp
cd hwapp

4. Execute the sample code to see the results


dotnet restore
dotnet run

If you see the familiar "Hello world" after execution, it means that you have successfully installed it.

These are the installation steps, and the deployment and operation will be introduced in the following blog.

Summarize


Related articles: