Click here to Skip to main content
15,895,746 members
Articles / Web Development / IIS

How to Install and Run ASP.NET Applications on Systems That Don't Have IIS

Rate me:
Please Sign up or sign in to vote.
4.73/5 (16 votes)
24 Dec 20058 min read 132.4K   607   90  
The article describes creating a Visual Studio .NET Setup Project that allows ASP.NET applications to be deployed on boxes that don't have IIS installed. Some familiarity with Visual Studio .NET Setup Projects will help better understand the material in this article.
using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration.Install;

namespace SampleNonIISWebApp
{
	/// <summary>
	/// Summary description for Installer1.
	/// </summary>
	[RunInstaller(true)]
	public class Installer1 : System.Configuration.Install.Installer
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

		public Installer1()
		{
			// This call is required by the Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitializeComponent call
		}

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		private static readonly Guid applicationID =
			new Guid("{3BE022C5-C34C-41ea-913E-F390E904B47D}"); // <= Replace the GUID with your own
             
		public override void Install(IDictionary savedState)
		{
			string appLocation = Context.Parameters["applocation"];
			CassiniConfiguration.Metabase.RegisterApplication(applicationID, 
				"Is IIS Neccessary?",			// <= Replace with your real application name
				"Life after IIS is fun!", 		// <= Replace with your real app description
				appLocation, "WebForm1.aspx");	// <= May need to replace default document name

			base.Install(savedState);
		}

		public override void Rollback(IDictionary savedState)
		{
			CassiniConfiguration.Metabase.UnregisterApplication(applicationID); 

			base.Rollback (savedState);
		}

		public override void Uninstall(IDictionary savedState)
		{
			CassiniConfiguration.Metabase.UnregisterApplication(applicationID);

			base.Uninstall (savedState);
		}

		#region Component Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			components = new System.ComponentModel.Container();
		}
		#endregion
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions