While it’s not provided with a default installation of Visual Studio 2019, it’s an official Microsoft extension. msi installer in Visual Studio 2019, you’ll need to install the Microsoft Visual Studio Installer Projects extension. So instead of using an installer, for a Worker Service you’d publish the project to an output directory and then use the SC.exe utility to add it as a Windows service: It can be configured to run as a Windows service, but doesn’t have to be. A Worker Service differs from a traditional Windows Service in that it’s more like a console application that spawns off a worker process on a new thread. NET 5.0 to make a service instead, you’d need to make a different kind of project called a Worker Service. NET 5.0 projects, you won’t be able to add an installer class.
Add an installer class to the service and use the installation lifecycle hooks to write custom code that gets run at any stage of the installation.įor.Add custom CLI flags to the installer to specify the Service Logon Account at install time.Configure the installer to copy the build output of a project to the C:\Program Files (x86) folder, as well as add custom files & folders to the installation.But once the installer is created, we can use it to do things like: In fact, the setup project itself is not included by default in Visual Studio you need to install an extension in order to create one. msi installer for a Windows Service that can do all these things and more.Ĭreating an installer can be tricky, because not all the available features are easy to find.
This article will go over how to make a dedicated. That’s when I realized a proper installation method was needed here. An entire checklist was needed just to make sure the service would start successfully. Adding external files & folders, setting a custom Service Logon Account, and even an SSL cert had to be configured first before the service could be used. For me, setting up a service started as a clean one-liner that used InstallUtil.exe, but as time went on, I accumulated additional steps.