-
Notifications
You must be signed in to change notification settings - Fork 4
/
Startup.EntryPoint.cs
67 lines (58 loc) · 2.04 KB
/
Startup.EntryPoint.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
namespace WebSite
{
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
[Mobilize.WebMap.Common.Attributes.ExcludeObservableWrapperTracking]
public partial class Startup
{
/// <summary>
/// Gets or sets the configuration.
/// </summary>
/// <value>
/// The configuration.
/// </value>
private static IConfiguration config { get; set; }
/// <summary>
/// Entry point of windows form application.
/// </summary>
/// <param name="args">The arguments.</param>
public static void Start(string[] args)
{
Mobilize.Web.Application.CurrentApplication.ControlsComponentized.Add("Mobilize.Web.TabPage");
SKS.modMain.Main();
}
/// <summary>
/// Entry Point of the web Application.
/// </summary>
/// <param name="args">The arguments.</param>
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}
/// <summary>
/// Returns a new WebHost
/// </summary>
/// <param name="args">run arguments</param>
/// <returns>a new WebHost</returns>
public static IWebHost BuildWebHost(string[] args){
config = new ConfigurationBuilder()
.AddJsonFile("appsettings.json", optional: true)
.Build();
return WebHost.CreateDefaultBuilder(args)
//// logging
//.ConfigureLogging(builder => builder.AddFile(options =>
//{
// options.FileName = "log-";
// options.LogDirectory = "LogFiles";
// options.FileSizeLimit = 20 * 1024 * 1024;
//}))
//// IIS Deployment
//.UseUrls("http://localhost:81")
//.UseIISIntegration()
.UseConfiguration(config)
.UseStartup<Startup>()
.Build();
}
}
}