Troubleshooting 101

It’s been far too long between blog posts so here’s a post and a promise to blog more frequently…   I thought I’d share some of my thoughts on this topic that’s been the focus of my career for the past 7.5 years.  I’ve tried to keep this as generic as possible.   Troubleshooting is…

3

Using Microsoft Network Monitor (Netmon) to capture a network trace

1) Download and install Netmon from the following URL.  Note, the password for the .zip is “trace”. ftp://ftp.microsoft.com/pss/tools/netmon/netmon2.zip 2) Start Netmon. Administrative Tools->Network Analysis Tools->Network Monitor 3) Select the appropriate network interface. The first time you run Netmon, you’ll be asked to select the network interface to trace.  The following command from the command line…

2

Using a Windows Azure startup script to prevent your site from being shutdown

Did you know that, by default, IIS will shutdown your site upon the following events? a) After being idle for 20 minutes.b) Every 29 hours (due to recycling). The first vistor to your site after one of these events will encounter a poor user experience (slow response) whilst a new IIS app pool is initialised. …

2

Storing database connection strings for Azure cloud services (including encypting the connection strings)

As my Surface didn’t arrive on launch day, I had nothing better to do on a Friday night so here’s a blog post on Azure configuration settings. Prior to Azure, web.config was the place ASP.NET devs would store settings.  However, as you should consider web.config read-only in Azure, you should use the Azure .cscfg instead IF…

2

Lucascan’s top 5 tips for a healthy ASP.NET application

These tips are reasonably well-known and have been blogged by others.  However, considering how often I come across these common “mistakes”, I felt yet another blog post was worthwhile: 1) Disable ASP.NET debugging in production! I cannot emphasize this enough, Set debug=”false” in all your web.config’s.   I’m regularly pleasantly surprised by how many production issues can…

2

ASP.NET instrumentation (tracing) to a file

It’s often helpful to instrument your code to help with troubleshooting, etc.  Instrumentation is really just a fancy word for tracing. Here’s an example of tracing to a file from ASP.NET. <%@ Page Language=”C#” CompilerOptions=”/d:TRACE” %><script runat=”server”>void Page_Load(object sender, EventArgs e){                System.Diagnostics.Trace.WriteLine(String.Format(“{0},{1}”, DateTime.Now, “Hello world!”));}</script> <configuration>  <system.diagnostics>    <trace autoflush=”true”>      <listeners>        <add name=”mytrace” type=”System.Diagnostics.TextWriterTraceListener” initializeData=”c:\temp\mytrace.csv” />     …

1

Reducing Netmon trace file size via capturing only a single port using a capture filter

This is a handy tip to reduce the file size of your Netmon traces.  This is particularlly useful when you need to leave the trace running for an extended period of time.   Thanks go to my collegue Andreja Rusjakovski for this tip… Just before starting the trace go to Capture->Filter->Load button and select a *.cf file. …

1

Building a Win7/2008 R2 box that boots off .vhd’s

A cool new feature in Windows7 & Server 2008 R2 is the ability to boot from a .vhd file! Having your OS isolated to a .vhd file has a number of advantages including but not limited to:- easier to backup, – multi-boot scenarios that are more isolated from each other,- ability to trial new builds on your…

1

Skip buttons weren’t working after installing Win7 RC

After installing Win7 RC on my production Media Center box (ie the box I literally can’t watch TV without) I noticed an annoying problem. The skip forward & back buttons didn’t work! At first I feared the issue was an intended “by design” change.  After all, I’m sure the commercial TV networks don’t like us skipping over…

1

.NET 2.0 WebException "The underlying connection was closed: A connection that was expected to be kept alive was closed by the server"

I’ve been working with a few customers lately that have been experiencing this WebException that has been confirmed as an issue introduced by connection management design changes incorporated into .NET 2.0.  The exception typically ocurrs during a web service call however any scenario involving a HttpWebRequest with keep-alives could encounter this issue.    Note, this…

1