Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 28th, 2004, 02:10 AM
Registered User
 
Join Date: May 2004
Location: chennai, , India.
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.

Reply With Quote
  #2 (permalink)  
Old May 28th, 2004, 07:17 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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?
Reply With Quote
  #3 (permalink)  
Old May 29th, 2004, 12:43 AM
Registered User
 
Join Date: May 2004
Location: chennai, , India.
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.

Reply With Quote
  #4 (permalink)  
Old June 2nd, 2004, 11:01 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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.
Reply With Quote
  #5 (permalink)  
Old June 3rd, 2004, 01:52 AM
Registered User
 
Join Date: Apr 2004
Location: Lahore, Punjab, Pakistan.
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...

:)

Reply With Quote
  #6 (permalink)  
Old June 3rd, 2004, 11:24 PM
Registered User
 
Join Date: May 2004
Location: chennai, , India.
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.

Reply With Quote
  #7 (permalink)  
Old June 9th, 2004, 12:09 AM
Registered User
 
Join Date: May 2004
Location: chennai, , India.
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.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:49 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.