且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Linux上运行.NET Core控制台应用程序

更新时间:2023-02-19 19:26:45

请按照以下步骤运行您的应用程序应用程序:

Follow the below steps to run your application:


  1. 将您的应用程序发布为自包含应用程序:

  1. Publish your application as a self contained application:

dotnet publish -c release -r ubuntu.16.04-x64 --self-contained


  • publish 文件夹复制到Ubuntu计算机上

  • Copy the publish folder to the Ubuntu machine

    打开Ubuntu计算机终端(CLI)并转到项目目录

    Open the Ubuntu machine terminal (CLI) and go to the project directory

    提供执行权限:

    chmod 777 ./appname
    


  • 执行应用程序

  • Execute the application

    ./appname