-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGlobal.asax.cs
62 lines (56 loc) · 1.59 KB
/
Global.asax.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
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Rook;
namespace TodoDemoDotNet
{
public class WebApiApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
try
{
System.IO.Directory.CreateDirectory(@"C:\\temp");
}
catch { }
Console.SetOut(new System.IO.StreamWriter(@"C:\\temp\\ConsoleOutput.txt"));
Thread pingThread = new Thread(() =>
{
while (true)
{
try
{
Console.Out.Flush();
}
catch
{
}
Thread.Sleep(1000);
}
});
pingThread.Start();
try
{
Rook.RookOptions o = new RookOptions();
o.debug = true;
Rook.API.Start(o);
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}