 |
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category.
** PLEASE BE SPECIFIC WITH YOUR QUESTION **
When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

May 28th, 2004, 02:10 AM
|
Registered User
|
|
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hosting ASP .NET pages outside IIS
Hi all,
I'm trying to host ASP .NET pages in my webserver(other than IIS).
I'm using ApplicationHost and SimpleWorkerRequest classes for this.I've a problem with ApplicationHost class.This is my code..
using System;
using System.IO;
using System.Web;
using System.Windows.Forms;
using System.Web.Hosting;
namespace AspxExecute
{
/// <summary>
/// Summary description for AspxHosting.
/// </summary>
public class AspxHosting
{
Host myHost;
public AspxHosting()
{
}
public bool CreateHost( string virtualDirectory )
{
try
{
myHost = (Host)ApplicationHost.CreateApplicationHost(typeof (Host),"/",virtualDirectory); //Creates Exception return true;
}
catch(Exception ex)
{
MessageBox.Show (ex.Message,"exception");
return false;
}
}
public string ExecuteAspx( string fileName )
{
return myHost.Execute( fileName );
}
}
public class Host : MarshalByRefObject
{
public string Execute( string fileName )
{
StringWriter wr = new StringWriter();
//create a worker to execute the aspx file
HttpWorkerRequest worker = new SimpleWorkerRequest(fileName, "" , wr);
//Execute the page
HttpRuntime.ProcessRequest(worker);
return wr.ToString();
}
}
}
I'm getting an exception with ApplicationHost.CreateApplicatioHost.The exception is
"File or assembly name AspxExecute,or one of its dependencies,was not found".I'm clueless abt this exception and i never faced such an exception before.
Can anyone help me to fix this problem.
Thanks a lot,
Suresh.
|

May 28th, 2004, 07:17 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Quote:
quote:Originally posted by sureshsundar007
I'm trying to host ASP .NET pages in my webserver(other than IIS).
|
Huh? How can you host ASP.NET pages in something other than IIS? Are you using Mono?
|

May 29th, 2004, 12:43 AM
|
Registered User
|
|
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No.I've written my own webserver which already supports cgi,perl,etc.
And i get a chance to study Professional .NET Network Programming by Wrox written by Andrew Krowczyk,Vinod Kumar, Nauman LAghari, Ajit Mungale,Chriatian Nagel,Tim Parker and Srinivasa Sivakumar.
In that book in page no.329 it is given that we can host ASP .NET pages in our own webservers and they have given the complete code for that also.I also tried the same code.But i'm getting the exception as stated in the first post.
Thanks for any help,
Suresh.
|

June 2nd, 2004, 11:01 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Sorry. my bad. I'm not used to questions regarding such advanced scenarios. I'll let someone else help.
|

June 3rd, 2004, 01:52 AM
|
Registered User
|
|
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The best way is that u ask this question to the ppl who have given the code
the can guide u batter coz this is something between what tye code of server says and whant .net wants...
:)
|

June 3rd, 2004, 11:24 PM
|
Registered User
|
|
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey...i fixed the problem by installing the above dll in the Global Assembly Cache.I can able to execute simpe ASP .NET pages now.
I've a my second problem now.I don't know how to pass the Querystring and the POSTed content to the ASP .NET executer dll.
Any help?
Suresh.
|

June 9th, 2004, 12:09 AM
|
Registered User
|
|
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
any help in handling Querystring and hiddedn data by the webserver for ASP .NET pages?
Suresh.
|
|
 |