Support localized operating system, run .Net Core on Linux

At present, many government projects require the server to be migrated to the linux series of operating systems. In the future, the office computers of government units will gradually migrate to domestic operating systems like Kirin, which won the bid. This is an inevitable trend, so, as a developer, it is a wise choice to deploy domestic operating systems in advance.

This article will introduce how to run a .Net Core-based server program on Linux, which is not fundamentally different from Java running on Linux. Java is based on the JVM, while .Net is based on the CLR.

We have shared two tools, namely XFTP and XSHELL, both of which can be downloaded from NetSarang official website .

1. Remotely connect to the LInux server

  Open XSHEll and create a new connection

         

  Enter account number, password,

  

  enter the system  

  

 

2. Set up the NetCore environment

  1.  add yum source
    rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm

  2. Upgrade all packages also upgrade software and system kernel
    yum update

  3. Install NetCore 3.1
    yum install dotnet-sdk-3.1
  4. Check version installation
    dotnet --version

3. Run the application

     Before, we need to use XFTP to upload the relevant files of the program to the Linux server. Here we take the NetCore version server running OrayTalk as an example, and the directory name is OrayTalk.

  1. Enter the running directory first
    cd oraytalk
  2. Execute the dotnet command to run
    //二种方式选其一种运行即可
    dotnet OrayTalk.Server.NetCore.dll   (关闭ssh后,程序也会关闭)
    nohup dotnet OrayTalk.Server.NetCore.dll & (程序后台运行,不会关闭)

    You're done!

         Later we will introduce the desktop application development based on the localized operating system, using the .Net Core-based UI framework Avalonia. Avalonia is a cross-platform UI framework that adopts WPF's XAML method and supports multiple operating systems: Windows, Linux (GTK), and MacOS. We will demonstrate how to rewrite the UI part of the OrayTalk client using Avalonia, and then we will share some technical points related to Avalonia during the implementation process, so stay tuned.

Guess you like

Origin blog.csdn.net/zhuweisky/article/details/106826325
Recommended