I have a blazor server app that I want to run on a raspberry pi. So far it is all good, I installed it as a service and the service is running like it should. I published the solution to srv/myApp
and I have a .service config for it. The only thing missing is the serving of the wwwroot
folder. When I open the app all the styles are missing. I have UseStaticFiles()
enabled. When I run it locally or just build the project with dotnet run
I get the styles from wwwroot
. The wwwroot
folder does exist in the published folder, though. It somehow just does not make it to my browser. I wanted to avoid running everything in nginx or something as I want to use the self hosting features.
Does anybody see what I am missing here? This is the project, if someone wants to take a look: https://github.com/modmoto/Deploynator
2
Answers
Ok, i finally found my issue, not all too firm with services on linux. What was missing was the following entry in my service file:
WorkingDirectory=/srv/Deploynator
So my complete .service file looks like this now:
Hope that this helps someone some day =)
If you use a program such as Supervisor to drive your service, be sure to set the working directory