Home >Backend Development >C#.Net Tutorial >Methods and steps to build .net core environment under Linux

Methods and steps to build .net core environment under Linux

PHPz
PHPzOriginal
2017-05-01 13:56:342216browse

This article mainly introduces you to the steps of deploying the .net core environment under Linux. The article gives a detailed introduction. I believe it has certain reference value for everyone's study or work. Friends who need it can join us below. Let's see.

Note: The environment for installing .net core on Linux requires a 64-bit system

Installation and deployment are as follows:

1. Add the 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. Install .NET Core SDK

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

sudo apt-get install dotnet-dev-1.0.1

3. Generate sample code

After installing the SDK, generate a sample code and check whether the installation is successful

dotnet new console -o hwapp
cd hwapp

4. Execute the sample code to view the results

dotnet restore
dotnet run

If you see the familiar "Hello world" after execution, it means that your installation is successful.

The above are the installation steps. Deployment and operation will be introduced in subsequent blogs.

Summarize

The above is the detailed content of Methods and steps to build .net core environment under Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn