Skip to content

Commit

Permalink
backup: fixed startup backup as WindowsService dotnet/AspNetCore.Docs…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeybannov committed Jan 21, 2022
1 parent d5c6ba0 commit afb1f56
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions common/services/ASC.Data.Backup/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
var builder = WebApplication.CreateBuilder(args);
using Microsoft.Extensions.Hosting.WindowsServices;

var options = new WebApplicationOptions
{
Args = args,
ContentRootPath = WindowsServiceHelpers.IsWindowsService() ? AppContext.BaseDirectory : default
};

var builder = WebApplication.CreateBuilder(options);

builder.Host.UseSystemd();
builder.Host.UseWindowsService();
builder.Host.UseSystemd();
builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());

builder.WebHost.ConfigureKestrel((hostingContext, serverOptions) =>
Expand Down

0 comments on commit afb1f56

Please sign in to comment.