Brian Ritchie's Blog

My ramblings on .NET & other development topics

News



Twitter

Blog Roll

Connect with me

Embedding XSP (Mono.WebServer) in your application

First off, I've contributed some code to the Mono guys to make XSP its own library.  You can get it as part of the 1.1.8 release.  I'm still working on getting a few more additions to the library, but it has all of the basics to get you going.

Download the install from http://www.mono-project.com/Downloads and get the Mono.WebServer.dll in the Mono-1.1.8\lib\mono\1.0 directory.

With that in mind, here's some code:

            int Port=8080;
            string path="\\XSPSamples";
            XSPWebSource websource=new XSPWebSource(IPAddress.Any,Port);
            ApplicationServer WebAppServer=new ApplicationServer(websource);
            //"[[hostname:]port:]VPath:realpath"
            string cmdLine=Port+":/:"+path;
            WebAppServer.AddApplicationsFromCommandLine(cmdLine);
            WebAppServer.Start(true);
            Console.WriteLine("Mono.WebServer running. Press enter to exit...");
            Console.ReadLine();
            WebAppServer.Stop();


The path should point at your ASP.NET files. That should do it...Enjoy!

NOTE: The API is probably not 100% stable, so you might need to "tweak" your application when a new Mono release comes out.

Comments

Corbin said:

Very cool Brian!

Hey do you know if your Mono Application Server is public knowledge or supported by the mono guys at all? The reason I ask as I see .NET application server as a missing piece in the .NET market. All we have is IIS and that keeps us on winders.

How complete is the project?
# August 11, 2005 9:41 AM

Gdsffsd said:

# May 25, 2007 8:23 AM

Make any .NET app a Web Server « Brian Nickel’s Online Journal said:

Pingback from  Make any .NET app a Web Server « Brian Nickel’s Online Journal

# June 12, 2007 6:41 PM

Olgunka-ef said:

<a href= membres.lycos.fr/maffals >genetic disorters</a>

# December 26, 2008 7:40 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)