mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-11-05 01:53:58 +08:00
fix: v6版本支持系统服务
This commit is contained in:
@@ -17,6 +17,7 @@ using Microsoft.AspNetCore.ResponseCompression;
|
|||||||
using Microsoft.AspNetCore.SignalR;
|
using Microsoft.AspNetCore.SignalR;
|
||||||
using Microsoft.AspNetCore.StaticFiles;
|
using Microsoft.AspNetCore.StaticFiles;
|
||||||
|
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.Encodings.Web;
|
using System.Text.Encodings.Web;
|
||||||
using System.Text.Unicode;
|
using System.Text.Unicode;
|
||||||
@@ -63,6 +64,11 @@ public class Program
|
|||||||
#region config
|
#region config
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||||
|
builder.Host.UseWindowsService();
|
||||||
|
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||||
|
builder.Host.UseSystemd();
|
||||||
|
|
||||||
// 增加中文编码支持网页源码显示汉字
|
// 增加中文编码支持网页源码显示汉字
|
||||||
builder.Services.AddSingleton(HtmlEncoder.Create(UnicodeRanges.All));
|
builder.Services.AddSingleton(HtmlEncoder.Create(UnicodeRanges.All));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user