Add support for running as service
This commit is contained in:
parent
2839b11893
commit
eef0b01758
2 changed files with 9 additions and 0 deletions
|
|
@ -102,6 +102,8 @@
|
|||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="9.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.1" />
|
||||
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.7.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
|
|
|||
|
|
@ -49,6 +49,13 @@ namespace LANCommander.Server
|
|||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddWindowsService(options =>
|
||||
{
|
||||
options.ServiceName = "LANCommander Server";
|
||||
});
|
||||
|
||||
builder.Services.AddSystemd();
|
||||
|
||||
ConfigurationManager configuration = builder.Configuration;
|
||||
|
||||
#region Debug
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue