Deploying .Net core console application to Debian server

前端 未结 3 531
Happy的楠姐
Happy的楠姐 2021-01-19 07:11

I have some problem with deploy simple .Net core console application to linux server.

I\'ve created simple console Hello world application this way:

         


        
3条回答
  •  天涯浪人
    2021-01-19 07:53

    You are copying the wrong stuff for deployment. When you dotnet publish, you should use the contents of the publish dir. For your case, it should be release/netcoreapp2.0/debian.8-x64/publish/.

    If you use the non-publish directory (release/netcoreapp2.0/debian.8-x64/), it will assume you want to run your project in development mode, and expects to use assets from the local nuget cache, which will most likely be missing on your deployment machine.

    FWIW, you are doing a few things very strangely. First, you need to decide if you want to really use self-contained deployments or not. If you are, you dont even need dotnet installed on the machine you are trying to deploy on.

提交回复
热议问题