From 0afb9718ac57f4feadccde83ab43915510e2a3f7 Mon Sep 17 00:00:00 2001 From: Alexander Gayko Date: Wed, 14 Jan 2026 21:34:14 +0100 Subject: [PATCH] DO NOT SIMPLY MERGE READ DESCRIPTION - InstallUtil doesn't work with net10? net core? service executables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We tried installing a service executable converted from .net framework 4.8 to net10 using installUtil, as suggested here, but that errored because of a BadImageFormatException: > Beim Initialisieren der Installation ist eine Ausnahme aufgetreten: System.BadImageFormatException: Die Datei oder Assembly "file:///D:\Publish\NexusCbfcLite\Nexus.BackgroundService.exe" oder eine Abhängigkeit davon wurde nicht gefunden. Im Modul wurde ein Assemblymanifest erwartet. i kinda expected that since ServiceUtil is a .net framework process. using `sc create` worked, though. documentation shoud reflect this (after this is cleared to be correct, of course) --- xml/System.ServiceProcess/ServiceBase.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xml/System.ServiceProcess/ServiceBase.xml b/xml/System.ServiceProcess/ServiceBase.xml index 13cb284cad1..7a3cd89eb0c 100644 --- a/xml/System.ServiceProcess/ServiceBase.xml +++ b/xml/System.ServiceProcess/ServiceBase.xml @@ -73,7 +73,9 @@ You do not have to implement , , or any other method in . However, the service's behavior is described in , so at minimum, this member should be overridden. The `main()` function of the executable registers the service in the executable with the Service Control Manager by calling the method. The property of the object passed to the method must match the property of the service installer for that service. - You can use `InstallUtil.exe` to install services on your system. + You can use `sc create` to install services on your system. + + > [!NOTE] > You can specify a log other than the Application event log to receive notification of service calls, but neither the nor the property can write to a custom log. Set to `false` if you do not want to use automatic logging.