Sunday, February 27, 2022

[SOLVED] ASP .NET CORE 2.0 - Unable to start service on Debian

Issue

I have a problem with .Net Core ConsoleApp. I am trying to run it on DebianOS 9.0 as daemon. As far I did: 1. Create app in Visual Studio. 2. Publish app from Visual Studio fox x64-linux 3. Copy code to DebianOS 4. Create service in /etc/systemd/system/newservice.service

Code of my service looks like:

[Unit]
Description=Test
DefaultDependencies=no

[Service]
ExecStart=/var/SystemdExample/ConsoleApp.dll
WorkingDirectory=/var/SystemdExample
Restart=always
RestartSec=10
User=netuser
SyslogIdentifier=ConsoleAppEx
Group=netuser

[Install]
WantedBy=multi.user.target

When i try to run it with systemctl start newservice.service The return of this command is something like:

'newservice.service: Main process exited, code=exited, status=203/EXEC'

Nothing else. Someone have idea how to resolve this?


Solution

You cannot run the DDL directly, you have to call it as parameter of dotnet

Something like this :

ExecStart=/usr/bin/dotnet /var/path/to/your/app/hellomvc.dll


Answered By - greyxit
Answer Checked By - Candace Johnson (WPSolving Volunteer)