locked
Why should I publish an ASP.Net Core project to deploy on Linux server? RRS feed

  • Question

  • User1230559574 posted

    I have a completed project created by ASP.Net Core 3.1 on my PC using VS 2019 on windows. Let's call it "Source Project". and I can publish it to a folder while target framework is  .NetCore-3.1 and target runtime is Linux-64, let's call it "Published version"

    I have a virtual machine "Ubuntu server" as my localhost. And this is my question: Why should I upload Published version to my server and run it , while I can upload complete source project and run it on my Ubuntu server successfully without any publish? Only some codes are different like "dotnet run" vs "dotnet Myproject.dll" but the code works truely in both cases.

    In the other hand, I have a source project folder containing : {  myProject.sln , MainApplication Folder, DataLayer Folder, ... }. Then I can copy this whole directory to my linux server and just run the following code in MainApplication Folder and the program starts succesfully :

    dotnet run

    I feel no need to published version at the moment but maybe there are some reasons that  we can publish a project. I searched a lot but all the places just saying how to do that and no body says why to do that while source code is running too .. 

    Sunday, June 28, 2020 3:40 PM

Answers

  • User-782232518 posted

    Why should I upload Published version to my server and run it , while I can upload complete source project and run it on my Ubuntu server successfully without any publish? Only some codes are different like "dotnet run" vs "dotnet Myproject.dll" but the code works truely in both cases.

    You personally can choose for whatever you like. Keep in mind the source code approach leaves too much garbage (intermediate files and so on) on the server, which others might not like.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, June 28, 2020 4:50 PM