PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms System.Web.Hosting

Reply

System.Web.Hosting

 
Thread Tools Rate Thread
Old 24-06-2003, 04:23 AM   #1
Ching-Lung
Guest
 
Posts: n/a
Default System.Web.Hosting


Hi,

*********
MyHost.cs
*********
using System;
using System.IO;
using System.Web;
using System.Web.Hosting;
using System.Diagnostics;

public class MyHost : MarshalByRefObject
{
public void CreateHtmlPage(string webPage, string
query, string file)
{
StreamWriter stream = new StreamWriter(file);
SimpleWorkerRequest swr = new SimpleWorkerRequest
(webPage, query, stream);
HttpRuntime.ProcessRequest(swr);
stream.Close();
}
}

********
Form1.cs
********
I am getting the following error message:
An unhandled exception of
type 'System.IO.FileNotFoundException' occurred in
mscorlib.dll

on line:
host = (MyHost)ApplicationHost.CreateApplicationHost
(typeof(MyHost), "/foo", Environment.CurrentDirectory);


Which file is it trying to open? Please help.

Thanks.

  Reply With Quote
Old 25-06-2003, 08:17 AM   #2
Xin Huang
Guest
 
Posts: n/a
Default RE: System.Web.Hosting

You need to put a copy of the MyHost assembly into .\bin directory. This
behavior is by design. ASP.NET loads its dependencies from the .\bin
folder. Also you can put the MyHost class to a separate DLL and register it
to the GAC.

Regards,
Xin

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. (c) 2003 Microsoft Corporation. All
rights reserved.

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off