4 using System.Web.Hosting;
8 namespace ConsoleApplication1
13 static void Main (string[] args)
15 string master = @"<%@ Master Language=""C#"" %>
16 <!DOCTYPE html PUBLIC ""-//W3C//DTD XHTML 1.0 Transitional//EN"" ""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"">
17 <html xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""en"" >
18 <head id=""Head1"" runat=""server"">
22 <asp:contentplaceholder id=""Main"" runat=""server"" />
25 string page = @"<%@ Page MasterPageFile=""My.master"" %>
26 <asp:content id=""Content1"" contentplaceholderid=""Main"" runat=""server"">
27 <form id=""form1"" runat=""server"" />
29 string physDir = Directory.GetCurrentDirectory ();
30 if (!Directory.Exists ("bin"))
31 Directory.CreateDirectory ("bin");
32 string masterPath = "My.master";
33 if (!File.Exists (masterPath))
34 using (StreamWriter sw = new StreamWriter (masterPath))
36 string pagePath = "PageWithMaster.aspx";
37 if (!File.Exists (pagePath))
38 using (StreamWriter sw = new StreamWriter (pagePath))
40 Class1 c1 = (Class1) ApplicationHost.CreateApplicationHost (
41 typeof (Class1), "/", physDir);