.NET CLI how to run app after publish on Linux

你离开我真会死。 提交于 2019-12-02 23:44:33
Thomas

Do the following steps (starting from a RC2 portable application; the normal one):

  1. Remove the "type": "platform" annotation from all your dependencies (so it is actuall self-contained and no longer rely on a installed .NET Core platform).
  2. Add a node runtimes to your project.json (so NuGet is able to pull the necessary platform parts to your local machine)

    Sample:

    "runtimes": {
      "osx.10.11-x64": { },
      "win10-x64": { },
      "ubuntu.14.04-x64": { }
    }
    
  3. dotnet restore (to make sure the new runtimes are locally available).

  4. dotnet build (if not already done for the portable app)
  5. dotnet publish -r ubuntu.14.04-x64 (to bundle it up)
  6. See the result directory with a platform specific dotnet command able to run the app.

I followed the steps found in the .NET Core documentation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!