This is a mirror of official site: http://jasper-net.blogspot.com/

How much traffic does your website create with each request? Use IISExpress 7.5 to find out.

| Monday, February 28, 2011
If you are currently using Cassini (the Visual Studio Development Web Server) – you will definitely want to switch to  IIS Express 7.5 because it is more aligned (feature wise) with IIS. Much has been written about IIS Express 7.5. The one feature I want to focus on here is IIS Express’ command prompt interface. Compliments of WebMatrix, IIS Express 7.5 has a nice GUI admin tool. What if however, you want to monitor traffic as part of your development activities. Sure, we can log that activity. But what if you want to see it real time. This is an area where IIS Express 7.5 shines.

Once IIS Express is installed, you will find it in Program Files (x86)\IIS Express. The configuration files can be found in Documents\IISExpress\config. The file you will be interested in is applicationhost.config. There is a lot going on with this XML configuration file. To get up and running, you can ignore most of it. The one section you will be interested in is <sites>. In VS 2010 SP 1, we will have the ability to configure IIS Express 7.5 within the IDE. For those that have not installed SP 1, getting up and running with IIS Express is actually quite simple.

By default, there is one site setup for you already:

1: <site name="WebSite1" id="1" serverAutoStart="true">
 2:     <application path="/">
 3:         <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
 4:     </application>
 5:     <bindings>
 6:         <binding protocol="http" bindingInformation=":8080:localhost" />
 7:     </bindings>
 8: </site>

To demonstrate, let’s setup NerdDinner to run under IIS Express. All we need to do is add an entry to applicationhost.config:

 1: <site name="NerdDinner" id="2" serverAutoStart="true">
 2:    <application path="/">
 3:       <virtualDirectory path="/" physicalPath="C:\NerdDinner" />
 4:    </application>
 5:    <bindings>
 6:       <binding protocol="http" bindingInformation=":50799:localhost" />
 7:    </bindings>
 8: </site>

Two requirements: 1 – the site name has to be unique. 2 – the id also has to be unique. Once you supply those two items, you need to specify the port. In the Project Properties Dialog, select the Web Tab. Make sure the Specific Port Option is selected. You can specify a port # or use the one that VS assigned. All you need to do is specify that port # in the bindingInformation attribute.

Read more: Los Techies

Posted via email from Jasper-net

0 comments: