mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-03-22 20:07:20 +08:00
【修复】修复项目多个文件编码为gb2312,导致vs code或者mac下出现乱码的情况。
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
using CoreCms.Net.Loging;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
@@ -11,12 +11,12 @@ using System;
|
||||
namespace CoreCms.Net.Web.Admin
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化
|
||||
/// 初始化
|
||||
/// </summary>
|
||||
public class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// 启动配置
|
||||
/// 启动配置
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
public static void Main(string[] args)
|
||||
@@ -24,24 +24,24 @@ namespace CoreCms.Net.Web.Admin
|
||||
var host = CreateHostBuilder(args).Build();
|
||||
try
|
||||
{
|
||||
//确保NLog.config中连接字符串与appsettings.json中同步
|
||||
//确保NLog.config中连接字符串与appsettings.json中同步
|
||||
NLogUtil.EnsureNlogConfig("NLog.config");
|
||||
//throw new Exception("测试异常");//for test
|
||||
//其他项目启动时需要做的事情
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Trace, LogType.Web, "网站启动", "网站启动成功");
|
||||
//throw new Exception("测试异常");//for test
|
||||
//其他项目启动时需要做的事情
|
||||
NLogUtil.WriteAll(NLog.LogLevel.Trace, LogType.Web, "网站启动", "网站启动成功");
|
||||
|
||||
host.Run();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//使用nlog写到本地日志文件(万一数据库没创建/连接成功)
|
||||
NLogUtil.WriteFileLog(NLog.LogLevel.Error, LogType.Web, "网站启动", "初始化数据异常", ex);
|
||||
//使用nlog写到本地日志文件(万一数据库没创建/连接成功)
|
||||
NLogUtil.WriteFileLog(NLog.LogLevel.Error, LogType.Web, "网站启动", "初始化数据异常", ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建启动支撑
|
||||
/// 创建启动支撑
|
||||
/// </summary>
|
||||
/// <param name="args"></param>
|
||||
/// <returns></returns>
|
||||
@@ -50,8 +50,8 @@ namespace CoreCms.Net.Web.Admin
|
||||
.UseServiceProviderFactory(new AutofacServiceProviderFactory()) //<--NOTE THIS
|
||||
.ConfigureLogging(logging =>
|
||||
{
|
||||
logging.ClearProviders(); //移除已经注册的其他日志处理程序
|
||||
logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace); //设置最小的日志级别
|
||||
logging.ClearProviders(); //移除已经注册的其他日志处理程序
|
||||
logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace); //设置最小的日志级别
|
||||
})
|
||||
.UseNLog() //NLog: Setup NLog for Dependency injection
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
@@ -59,7 +59,7 @@ namespace CoreCms.Net.Web.Admin
|
||||
webBuilder
|
||||
.ConfigureKestrel(serverOptions =>
|
||||
{
|
||||
serverOptions.AllowSynchronousIO = true;//启用同步 IO
|
||||
serverOptions.AllowSynchronousIO = true;//启用同步 IO
|
||||
})
|
||||
.UseStartup<Startup>();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user