How to run in linux server?

Take the Ubuntu 21.10 operating system as an example:

  1. Install Ubuntu 21.10 operating system, go to the website to download:
  2. Open the "Terminal" program.

  3. Before installing .NET, run the following commands to add the Microsoft package signing key to the list of trusted keys and add the package repository. Enter the following command:
    wget -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb

  4. Install the .NET Runtime runtime. Enter the following command:
    sudo apt-get update; \ sudo apt-get install -y apt-transport-https && \ sudo apt-get update && \ sudo apt-get install -y aspnetcore-runtime-5.0

  5. Verify that the .Net Core runtime environment is successfully installed
    Enter "dotnet", and the following information is displayed, indicating that the installation is successful.

  6. Copy the sample program to the system, and enter the following command to run the sample program.
    dotnet /{root}/IoT.Example.ConsoleApp.dll