Whether programmer or administrator, we're always looking for details on certain ASP.NET or IIS configuration settings, and sometimes we come up wanting because of lack of good documentation.
The IIS team released an impressive IIS 7 reference a couple nights ago. You can find it here: http://www.iis.net/configreference. This is a reference definitely worth bookmarking. You can take every IIS configuration item, click on it on the side and be provided with detailed information written directly from the IIS team. Robert McMurray has worked hard to survey the product team directly to obtain a wealth of detailed information about every configuration setting, and Pete Harris and others have been hard at work helping make this happen.
Along with most sections is a full description, info on where the setting lives, a full list of Attributes with description of each one, often setup information and configuration samples and code/command samples for appcmd, Microsoft.Web.Administration and AHAdmin code samples for .NET (C#, VB.NET), JavaScript or VBScript.
I used it yesterday already to refresh my memory about responseMode for httpErrors: http://www.iis.net/ConfigReference/system.webServer/httpErrors.
Bill Staples announced it on his blog yesterday too.
This reference is well worth bookmarking. It will come in handy.
I work with web farms on a daily basis, and one of the requirements that I run into, for testing, troubleshooting and logging, is to tell which node is handling a specific request.
To use a current example, at ORCS Web, we're testing Microsoft's new Application Request Routing Module (ARR) for performance, stability and features to see if it offers value along-side our other load balancing solutions. (Note: ARR is still in RC1 at the time of this writing) During testing, I want to be able to tell how ARR is distributing the load under different settings. Does a custom round robin setting really work as promised? Does the least current requests work? How can I tell and test? Etc, etc.
One simple but important piece of information that I want to see over and over is which server node is being served. Without knowing the server name of the web node, it's just a guessing game, and the testing is pretty useless.
Fortunately the solution is trivial in ASP.NET. There are multiple ways to do it, but two namespaces that expose the machine name are System.Environment and System.Web.HttpContext.Current.Server.
To create a testing page that exposes the server name in VB.NET, create a file called CurrentNode.aspx with the following in it:
<%
Response.Write (System.Environment.MachineName)
%>
Or, if you're using C#, the only difference is the ; (semi-colon) requirement on the end:
<%
Response.Write (System.Environment.MachineName);
%>
That is literally all that I put in the file, or else I tack this on the bottom of an existing page. You'll notice that it's not valid HTML and nothing fancy, but no common browsers will complain, this is something that I can memorize and quickly type, and it's fully functional.
The computer name is obtained by Windows on system boot-up by reading the registry value.
I'm not aware of any differences in functionality, but you can use the following instead:
<%
Response.Write (HttpContext.Current.Server.MachineName)
%>
Hit that page from the load balancer's IP (often called a VIP [virtual IP]) and you'll know which node is handling the request.
This comes in useful for troubleshooting failures too. You may have users saying that they are receiving errors on your site, but you're unable to reproduce it consistently. Expose the server name in your error logging so that you know if it's something specific to particular nodes, or if it's global across all nodes.
I don’t tend to blog too much about myself personally, but I thought I would break my mold and start off the new year with an exciting non-technical project I worked on over Christmas. This will hopefully kick off a year of more consistent blogging since I’ve been pretty quiet the last year.
Being from Canada (I’ve lived in the States for 5 years) my family is a long way away and is only able to visit every couple years. This year we planned a 2 week vacation. My parents came down from Northern Canada (in the Sub-Arctic) and my Sister and family came down from Eastern Canada.
My father’s thought of a great vacation is one where he works on a large unique project. I need to find something to build or do before he comes to visit. Note that he’s also in the computer industry, but \isn’t scared to take on any type of project. When we visited my sister’s family a few years ago, he rented a back-hoe, and we tore up her lawn and replaced the drainage along their house. When I visited my parents 2 years ago, he bought a cow, and we killed and butchered it. So, as you can guess, he was anxious for something along those lines. He suggested a treehouse, which we all thought would be very exciting, and we started looking at pictures online and dreaming up different ideas of what we would like. Of course, being the non-experts that we are, we dreamed really big, thinking it would be easily doable.
Well, to make a long story short, we had a great vacation, working until about 2:00AM most days by the time we drew out our plans for the next day, created the bill of materials and all of that. We stopped sometimes to do something non-tree-house-related with the rest of the family, and of course the rest of the family joined in also. For the most part we worked around the clock. I’ll let the following pictures tell the rest of the story.
How does a computer geek with a Prius transport lumber? Use the Prius of course! That’s me standing there. (We got a truck for some of the materials, but the Prius worked for many of our small trips.)
Here’s my son Joel after we got the main beams in place. The design allows the trees to move in the wind without stressing the treehouse. The main platform sits on the cross beam that Joel is leaning against with some metal plates to allow movement as needed. It is amazing the force of the tree movement when it moves.

My daughter Alisha figured that even 2 beams was enough to sit in the ‘treehouse’ and read a book. She’s a real outdoors person.
Here we are with the 6x6 posts were in place and we started to lay the 2x6’s for the floor. The weather was fairly nice. It was warm some days and cold other days and often rainy, but it was never too cold or wet to keep us from working. Got to love North Carolina.

Here’s my father in the garage, with the back wall built and leaning up against the garage to mostly hide it from the rain.
Here’s the same view from the other side.
Alisa did most of the platform screws.
After getting going, we realized that leg bolts screwed into the tree wouldn’t be enough, so I had to get better drilling equipment to drill a hole right through the Oak trees and use threaded rods instead. Getting through the trees was not easy!

Getting ready to put up the walls, which we build in advance in the garage.
Further progress.
Front view
My sister trying out the view.
Here I am, working on the edge. This is the floor of the loft that I’m on.

Here’s my wife, Melissa, and kids in the partially finished loft. It’s 4 feet high, so not meant for the big people except sleeping.
Working on the roof was a lot of fun.
And for Christmas, we also got a zipline. Alisha is trying it out. We all love this.
My wife was the architect and builder for the rope bridge. She’s working on it now.
We got the mailbox for Christmas too!
Here’s the rope bridge. It worked out really well.
The patio
The inside isn’t finished yet, but here’s a view of the entry to the loft. The kids built the ladder by themselves!
Here’s the treehouse with the four of us hidden in it. Can you find us?
I’m sure we could have gotten a better picture, but here’s me on the zipline.
And, for New Year’s Eve, we had it ready enough to put up some lights for a party at our house.To wrap up, here’s a video my wife put together of the building: www.forsythfamily.com/treehouse-movie.wmv
This was a rewarding project for the family. I learned a ton and enjoyed the process. There are some loose ends to finish since we’re running electricity and insulating it so that it’s usable throughout all but the hottest months of the summer. It was definitely a much larger project that we originally expected, but having a usable treehouse in the backyard is worth it all!