Add Windows Service support to enable service deployment
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.20" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -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 =>
|
||||
|
||||
Reference in New Issue
Block a user