在CentOS 7 下安装.Net 框架

来源:互联网 发布:语音录入软件 编辑:程序博客网 时间:2024/06/06 02:34

https://www.microsoft.com/net/core#linuxcentos

Install for CentOS 7.1 (64 bit) & Oracle Linux 7.1 (64 bit)

  1. 1

    Install .NET Core SDK

    Before you start, please remove any previous versions of .NET Core from your system.

    In order to install .NET Core 1.1 on CentOS or Oracle Linux, first you need to get the prerequisites and then you download the .NET Core SDK binaries, extract them onto your system and put dotnet onto your PATH.

    For other releases you can check the Linux downloads section.

    1. sudo yum install libunwind libicu
    2. curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?linkid=848821
    3. sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet
    4. sudo ln -s /opt/dotnet/dotnet /usr/local/bin
  2. 2

    Initialize some code

    Let's initialize a sample Hello World application!

    1. dotnet new console -o hwapp
    2. cd hwapp
  3. 3

    Run the app

    The first command will restore the packages specified in the project file, and the second command will run the actual sample:

    1. dotnet restore
    2. dotnet run