using System;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Util.Logs;
using Util.Logs.Extensions;
namespace Util.Samples.Webs {
///
/// 应用程序
///
public class Program {
///
/// 应用程序入口点
///
/// 入口点参数
public static void Main( string[] args ) {
try {
WebHost.CreateDefaultBuilder( args )
.UseStartup()
.Build()
.Run();
}
catch ( Exception ex ) {
WriteLog( ex );
}
}
///
/// 记录错误日志
///
private static void WriteLog( Exception ex ) {
ex.Log( Log.GetLog().Caption( "应用程序启动失败" ) );
}
}
}