Click here to Skip to main content
12,548,119 members (47,873 online)
Click here to Skip to main content
Add your own
alternative version


56 bookmarked

ASP.NET IIS Chameleon Tool

, 15 Feb 2006
Rate this:
Please Sign up or sign in to vote.
A tool to set one specific IIS Virtual Directory for a lot versions of the same web project.

IIS Chameleon


The ASP.NET IIS Chameleon is a tool to set one specific IIS Virtual Directory for a lot versions of the same web project.


Some web projects in our company, have at least two versions:

  • "internal" - An internal beta version, where the team builds new features.
  • "launched" - All the already launched versions of the same project.

Our developers team need to code/correct both versions, depending on the necessity. Therefore, we need to switch faster between all these versions. Now, we're working with both versions: VS2003 (.NET Framework 1.1) and VS2005 (.NET Framework 2.0). We have designed a structure for our development machines, that makes it easy to apply changes and manage our source code, linked with specific virtual directories. Take a look at the structure design:

Logic Structure Model


Each developer needs to map, as soon as possible, a specific version of a project (this one could be a random physical directory) to its IIS Web Shared Directory, so our team can start the maintenance or new implementations.

Older Solution

Well, for each "version change process", a developer needs to check in all files, get the specific/target version, then run aspnet_regiis.exe* for the specific metabase path and for the specific .NET Framework version. Another solution is running the Internet Information Services (inetmgr.exe), and then change the physical directory for a specific virtual directory, and the ASP.NET version too.

Newer Solution

Basically, we build a Windows Forms application tool named IISChameleon to join and automate some aspnet_regiis.exe and inetmgr.exe tasks. This tool was built with VS2005 and runs over .NET Framework 2.0. Our team has Windows XP Professional and Internet Information Services 5.1.

How To Use

This tool will load a list of all the virtual directories in your machine; just select the entry, change all values you want, and click the Update button, and hands on.

How IISChameleon Works

We take advantages of the System.DirectoryServices.DirectoryEntry class from System.DirectoryServices.dll and the process aspnet_regiis.exe.

DirectoryEntry* Class

Before manipulating entries on IIS with the DirectoryEntry class, we need to know the basic ideas about how IIS manages these entries. Each IIS entry (web site, web virtual directory, FTP virtual directory, ...) has a schema name and a collection of properties. All entries follow a hierarchy, with parent entries and children entries. These hierarchies are defined by a metabase path, which means that every entry, similar to physical directories, has a path. A sample of this hierarchy can be viewed in the following picture (a shot of the Metabase Editor* tool):

Metabase Editor Tool

To instantiate a DirectoryEntry, we basically need its metabase path.

DirectoryEntry directoryEntry = 
      new DirectoryEntry("IIS://localhost/w3svc/1/root");

The most of its properties should be accessed by indexers.

Console.Write( directoryEntry.Properties["Path"].Value.ToString() );

ASP.NET IIS Registration Tool (aspnet_regiis.exe)

This is used to discover all ASP.NET versions in the current machine, and to register a version of ASP.NET for a specific virtual directory.

Definitions File

The definitions.xml is used to store information about all the runtimes installed. So, maybe you will edit this one.

    <version alias="1.1"  baseDir="v1.1.4322"   full="1.1.4322.2032"/>
    <version alias="2.0"  baseDir="v2.0.50727"  full="2.0.50727.0"/>

IISChameleon User Interface

To build the user interface, we use some native controls coming from .NET Framework 2.0 and a simple JPGrid*.


IISChameleon, when combined with a standard structure of directories and versions, could be usual for developer teams, and support teams too.



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


About the Author

Brazil Brazil
im just a developer,..

You may also be interested in...


Comments and Discussions

Generalfind Dot net version installed in system Pin
mjavid6225-May-07 21:54
membermjavid6225-May-07 21:54 
GeneralAspNetIsInstalled always return false Pin
Michael Freidgeim16-Aug-06 20:58
memberMichael Freidgeim16-Aug-06 20:58 
GeneralUseful to be called from Web Setup Pin
Michael Freidgeim10-May-06 19:27
memberMichael Freidgeim10-May-06 19:27 
GeneralVery nice!!! Pin
brunzefb8-Mar-06 11:07
memberbrunzefb8-Mar-06 11:07 
JokeBoa idéia Pin
Patrick Antonioli16-Feb-06 4:15
memberPatrick Antonioli16-Feb-06 4:15 
GeneralExcellent Utility Pin
Michael McKechney3-Jan-06 15:50
memberMichael McKechney3-Jan-06 15:50 
GeneralDo you mean &quot;Chameleon&quot; Pin
Peter Ritchie29-Dec-05 10:08
memberPeter Ritchie29-Dec-05 10:08 
AnswerRe: Do you mean &quot;Chameleon&quot; Pin
joaoPaulo24-Jan-06 23:52
memberjoaoPaulo24-Jan-06 23:52 
GeneralNeat Idea! Pin
Hrusikesh28-Dec-05 4:26
memberHrusikesh28-Dec-05 4:26 
AnswerRe: Neat Idea! Pin
joaoPaulo25-Jan-06 0:00
memberjoaoPaulo25-Jan-06 0:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161021.1 | Last Updated 16 Feb 2006
Article Copyright 2005 by joaoPaulo
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid