I am getting the following error:
Jun 03 06:41:04 {my_digital_ocean_server} systemd[13752]: kestrel-hellomvc.service: Failed at step CHDIR spawning /usr/bin/dotnet: No such file or directory
-- Subject: Process /usr/bin/dotnet could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /usr/bin/dotnet could not be executed and failed.
When running:
systemctl start kestrel-hellomvc.service
following this guide: https://learn.microsoft.com/en-us/aspnet/core/publishing/linuxproduction
Running: nano /usr/bin/dotnet
gets me a large file with content, and which dotnet
returns
/usr/bin/dotnet, so the file does exist(?).
Why am I getting this error, and what is the solution?
EDIT: My /etc/systemd/system/kestrel-hellomvc.service file:
[Unit]
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
SyslogIdentifier=dotnet-example
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
[Install]
WantedBy=multi-user.target