1 Dim tw As TextWriter = New StringWriter
2 Dim wr As New SimpleWorkerRequest("/webapp", "C:\\inetpub\\wwwroot\\webapp\\", "default.aspx", "", tw)
3
4 HttpContext.Current = New HttpContext(wr)
5
6 If HttpContext.Current.Items("DataContextFactory") Is Nothing Then
7 Dim dc As DataContextFactory = New DataContextFactory(System.Configuration.ConfigurationManager.ConnectionStrings("EntitiesDataContext").ConnectionString)
8 HttpContext.Current.Items.Add("DataContextFactory", dc)
9 End If