PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
System.Web.Hosting
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
System.Web.Hosting
![]() |
System.Web.Hosting |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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. |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

