Fixed windows service.
This commit is contained in:
parent
9a278d4fd3
commit
bd5d96d2c3
2 changed files with 6 additions and 14 deletions
|
|
@ -2,6 +2,7 @@ using System.Diagnostics;
|
|||
using System.Net;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.Extensions.Hosting.WindowsServices;
|
||||
using RdtClient.Data.Data;
|
||||
using RdtClient.Data.Models.Internal;
|
||||
using RdtClient.Service.Middleware;
|
||||
|
|
@ -10,7 +11,11 @@ using Serilog;
|
|||
using Serilog.Events;
|
||||
using Serilog.Exceptions;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
var builder = WebApplication.CreateBuilder(new WebApplicationOptions
|
||||
{
|
||||
Args = args,
|
||||
ContentRootPath = WindowsServiceHelpers.IsWindowsService() ? AppContext.BaseDirectory : default
|
||||
});
|
||||
|
||||
// Bind the AppSettings from the appsettings.json files.
|
||||
builder.Configuration.AddJsonFile("appsettings.json", false, false);
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"Logging": {
|
||||
"File": {
|
||||
"Path": "C:/Temp/rdtclient/rdtclient.log",
|
||||
"FileSizeLimitBytes": 5242880,
|
||||
"MaxRollingFiles": 5
|
||||
}
|
||||
},
|
||||
"Database": {
|
||||
"Path": "C:/Temp/rdtclient/rdtclient.db"
|
||||
},
|
||||
"Port": "6500"
|
||||
}
|
||||
Loading…
Reference in a new issue