Last post May 10, 2019 09:51 PM by Metonymy
May 08, 2019 03:29 PMemail@example.com|LINK
I am looking for best option to deploy .Net Core Console/standalone application in Windows / Linux environment , any suggestions ?
May 08, 2019 10:27 PM|lextm|LINK
What are the requirements? There is no blind "best" option so far.
May 09, 2019 03:40 AMfirstname.lastname@example.org|LINK
I have a .net core 2.2 console application , from my local I run the application by dotnet <mydll>. I want to deploy my application to dev environment as windows service . Reading the below article says , There is no direct support for creating Windows
Services in .Net Core. Look for other alternate option to run as daemon .
May 09, 2019 07:50 AM|Sherry Chen|LINK
Hi Sundervel S Perumal ,
You could try to refer to the options mentioned in the first link and the second tutorial on creating a Windows Service using .Net Core 2.2 :
Best Regards ,
May 10, 2019 09:51 PM|Metonymy|LINK
If you're using a Linux environment then you can use systemd (for distros that support this).
First publish your application:
dotnet publish --output publish --configuration release
Then, you'll need to create a script with execute privileges that runs your dotnet console app.
Then you'll need to create a systemd service file in the following location;
sudo touch /etc/systemd/system/my_dotnet.service
and populate the file with:
You can then use the following commands with your new service:
sudo systemctl enable my_dotnet // enable at boot and start servicesudo systemctl disable my_dotnet // disable at boot and stop servicesudo systemctl start my_dotnet // start servicesudo systemctl stop my_dotnet // stop servicesudo systemctl restart my_dotnet // restart service
Another way of deploying your application would be to use Docker. If this isn't the answer you were looking for then maybe this helps: https://docs.microsoft.com/en-us/dotnet/core/deploying/