From 029ad2b3eff465e390ec6a87555be9cd636d8565 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Mon, 27 Oct 2025 19:22:18 -0400 Subject: [PATCH] Add Windows Service support to enable service deployment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add Microsoft.Extensions.Hosting.WindowsServices package (v8.0.1) - Configure host to use Windows Service lifetime management - Enables proper startup/shutdown when installed via Deploy-PepApi.ps1 Fixes issue where service would fail to start when deployed as Windows Service. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- PepApi.Core/PepApi.Core.csproj | 1 + PepApi.Core/Program.cs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/PepApi.Core/PepApi.Core.csproj b/PepApi.Core/PepApi.Core.csproj index 7cc1e4a..4854c3a 100644 --- a/PepApi.Core/PepApi.Core.csproj +++ b/PepApi.Core/PepApi.Core.csproj @@ -8,6 +8,7 @@ + diff --git a/PepApi.Core/Program.cs b/PepApi.Core/Program.cs index 8768dcf..f063a4f 100644 --- a/PepApi.Core/Program.cs +++ b/PepApi.Core/Program.cs @@ -4,6 +4,9 @@ using PepLib.Data; var builder = WebApplication.CreateBuilder(args); +// Enable Windows Service hosting +builder.Host.UseWindowsService(); + // Add services to the container builder.Services.AddControllers() .AddJsonOptions(options =>