Dear all,
I've created a service to start a .net core desktop application (Avalonia) and if the application is closed or if it crashed it starts automatically.
It all works almost as expected, if I start the service after the system is already boot, my application starts maximized. If I reboot my system, my application does not start maximized and I've to do it manually.
Here is my setup:
Hardware: Raspberry pi 4B
OS: Raspberry Pi Os
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
my service:
-------------------------------
[Unit]
Description=Dotnet Desktop App
After=multi-user.graphical.target
[Service]
Type=simple
Environment="DISPLAY=:0"
WorkingDirectory=/home/pi/Release/net6.0/
ExecStart=/home/pi/dotnet/dotnet /home/pi/Release/net6.0/Myapp.dll
StandardOutput=inherit
StandardError=inherit
Restart=always
RemainAfterExit=no
User=pi
[Install]
WantedBy=graphical.target
-------------------------------
Note that "Myapp" was compiled in order to start automatically maximized (WindowState="Maximized" -> property in mainwindow xaml) but when launched by the service at system boot, that does not work.
Thank you in advance for your help!
Regards
I've created a service to start a .net core desktop application (Avalonia) and if the application is closed or if it crashed it starts automatically.
It all works almost as expected, if I start the service after the system is already boot, my application starts maximized. If I reboot my system, my application does not start maximized and I've to do it manually.
Here is my setup:
Hardware: Raspberry pi 4B
OS: Raspberry Pi Os
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
my service:
-------------------------------
[Unit]
Description=Dotnet Desktop App
After=multi-user.graphical.target
[Service]
Type=simple
Environment="DISPLAY=:0"
WorkingDirectory=/home/pi/Release/net6.0/
ExecStart=/home/pi/dotnet/dotnet /home/pi/Release/net6.0/Myapp.dll
StandardOutput=inherit
StandardError=inherit
Restart=always
RemainAfterExit=no
User=pi
[Install]
WantedBy=graphical.target
-------------------------------
Note that "Myapp" was compiled in order to start automatically maximized (WindowState="Maximized" -> property in mainwindow xaml) but when launched by the service at system boot, that does not work.
Thank you in advance for your help!
Regards