Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
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
 
Old May 28th, 2004, 02:10 AM
Registered User
 
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

 
Old May 28th, 2004, 07:17 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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?
 
Old May 29th, 2004, 12:43 AM
Registered User
 
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

 
Old June 2nd, 2004, 11:01 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Sorry. my bad. I'm not used to questions regarding such advanced scenarios. I'll let someone else help.
 
Old June 3rd, 2004, 01:52 AM
Registered User
 
Join Date: Apr 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Shahzad_Hussain
Default

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...

:)

 
Old June 3rd, 2004, 11:24 PM
Registered User
 
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

 
Old June 9th, 2004, 12:09 AM
Registered User
 
Join Date: May 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

any help in handling Querystring and hiddedn data by the webserver for ASP .NET pages?

Suresh.






Similar Threads
Thread Thread Starter Forum Replies Last Post
.net remoting problem while hosting in public IIS dotnetpranker C# 3 March 19th, 2007 07:05 AM
How to run asp pages in IIS femina ASP.NET 1.0 and 1.1 Basics 20 February 22nd, 2006 12:31 PM
Cannot view asp pages with Win XP Pro (IIS 5.1) amonte Classic ASP Basics 6 January 23rd, 2005 06:16 PM
IIS Problem with ASP Pages rodmcleay Classic ASP Basics 2 April 18th, 2004 08:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.