* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.Web / Test / standalone / configuration / 78256 / Program.cs
1 using System;
2 using System.Web.Hosting;
3 using System.IO;
4
5 namespace dumb2
6 {
7         class Program
8         {
9                 static void SetupAppHost (string baseDir)
10                 {
11                         if (File.Exists (baseDir))
12                                 File.Delete (baseDir);
13                         Console.Write ("App base: ");
14                         Console.WriteLine (baseDir);
15                         Directory.CreateDirectory (baseDir);
16                         string binDir = Path.Combine (baseDir, "bin");
17                         Directory.CreateDirectory (binDir);
18                         foreach (System.Reflection.Assembly a in AppDomain.CurrentDomain.GetAssemblies ()) {
19                                 if (a.GlobalAssemblyCache) continue;
20                                 string loc = a.ManifestModule.FullyQualifiedName;
21                                 if (loc.EndsWith (".exe", true, System.Globalization.CultureInfo.CurrentCulture))
22                                         continue;
23                                 string fn = Path.GetFileName (loc);
24                                 File.Copy (loc, Path.Combine (binDir, fn));
25                         }
26                 }
27
28                 static void Main (string[] args)
29                 {
30                         string baseDir1 = Path.GetTempFileName ();
31                         SetupAppHost (baseDir1);
32                         ClassLib.Host h1 = (ClassLib.Host) ApplicationHost.CreateApplicationHost (
33                                 typeof (ClassLib.Host), "/test", baseDir1);
34                         h1.Run ();
35
36                         string baseDir2 = Path.GetTempFileName ();
37                         SetupAppHost (baseDir2);
38                         FileStream fs = new FileStream (Path.Combine (baseDir2, "Web.config"), FileMode.CreateNew);
39                         StreamWriter sw = new StreamWriter (fs);
40                         sw.Write ("<?xml version=\"1.0\"?><configuration><system.web><pages styleSheetTheme=\"White\"/></system.web></configuration>");
41                         sw.Close ();
42                         ClassLib.Host h2 = (ClassLib.Host) ApplicationHost.CreateApplicationHost (
43                                 typeof (ClassLib.Host), "/test", baseDir2);
44                         h2.Run ();
45
46                 }
47         }
48 }