From cf3162922efba10141e787b9d677ec2fb93bf84a Mon Sep 17 00:00:00 2001 From: Paul Kim Date: Wed, 1 Feb 2017 18:15:39 -0800 Subject: [PATCH] Update service file to set WorkingDirectory Since the ASP.NET Core application is run from /etc/systemd/system directory, the working directory is no longer /var/aspnetcore/hellomvc. Update the service file to set WorkingDirectory=/var/aspnetcore/hellomvc so that the program will run. Otherwise, users will get System.IO.FileNotFoundException when using systemd to monitor and run ASP.NET Core application. --- aspnetcore/publishing/linuxproduction.md | 1 + 1 file changed, 1 insertion(+) diff --git a/aspnetcore/publishing/linuxproduction.md b/aspnetcore/publishing/linuxproduction.md index f880846d9b..905bd44610 100644 --- a/aspnetcore/publishing/linuxproduction.md +++ b/aspnetcore/publishing/linuxproduction.md @@ -122,6 +122,7 @@ An example service file for our application. Description=Example .NET Web API Application running on Ubuntu [Service] + WorkingDirectory=/var/aspnetcore/hellomvc ExecStart=/usr/bin/dotnet /var/aspnetcore/hellomvc/hellomvc.dll Restart=always RestartSec=10 # Restart service after 10 seconds if dotnet service crashes