Skip to main content

Windows Services

Server Service:

First, we need to publish the Utopia Project.

image.png

After that we need to create the service by running the command (use Admin Command Prompt):
SC CREATE "ServerService" binpath="C:\Projects\Efilecabinet\Utopia\Utopia\Utopia\bin\Release\netcoreapp3.1\publish\Utopia.exe"

The bin path it's the path of the publish project + "Utopia.exe".

Now the service it's created. We can open the Services app of windows and check it.

image.png

The logs go to this path or similar:

image.png

Useful commands:

Delete the service:

sc.exe delete "ServerService"

Stop the service:

sc stop "FileOCRService"

List of the service names and projects:

FileOCRService - File OCR worker
Index Service - File Indexing worker
Rubex Service - Utopia Batch Worker
Server - Utopia

All the projects use .net core worker sdk, except File OCR Worker that continues on .net framework. For this project, we need to use the exact same name on the creation of the service. And if an error like this one ("Login failed for user 'NT AUTHORITY\SYSTEM'. Reason: Failed to open the explicitly specified database 'UtopiaDB2'. [CLIENT: <local machine>]") occurs, we need to create the user 'NT AUTHORITY\SYSTEM' on the db with all permissions.

Checking Event Viewer windows app it's useful for debugging services that fail to start for example.

image.png