-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
71 lines (58 loc) · 2.1 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System.IO;
using Microsoft.CodeAnalysis;
//using TextTemplating.Infrastructure;
namespace WebApplication2Vue
{
public class Program
{
public static IConfigurationRoot config { get; set; }
public static void Main(string[] args)
{
// Retrieve the configuration information.
// Retrieve the configuration information.
Startup.config = config = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", optional: true)
.AddCommandLine(args)
.AddEnvironmentVariables(prefix: "ASPNETCORE_")
.Build();
//j
var host = Host.CreateDefaultBuilder(args)//new WebHostBuilder()
.ConfigureAppConfiguration(builder => builder.AddConfiguration(config))
// .ConfigureLogging((hostingContext, logging) =>
// {
// logging.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
// logging.AddDebug();
// logging.AddNLog();
// })
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseWebRoot("dist");
// webBuilder.UseIISIntegration();
webBuilder.UseContentRoot(Directory.GetCurrentDirectory());
webBuilder.UseKestrel();
//webBuilder.UseNLog();
webBuilder.UseStartup<Startup>();
});
RunSomeTasks();
// Log.Debug("caaling host run");
host.Build().Run();
}
private static void RunSomeTasks()
{
//testc t = new testc();
}
}
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
}
}