Ken Muse improves WebResourceHandler

Last Tuesday I got an email from Ken Muse, asking for the source code of the WebResourceHandler. You couldn’t download it, because I was smart enough (not!) to upload the .cs file. I’ve since changed the file to a zip file. Anyway, Ken was the first who ran into this problem and actually contacted me on it. He has taken the source code and implemented the timestamp and substitution feature. He did a very nice job.Here’s the way he got a timestamp, which I think is a pretty nifty way of doing it.

// Validate timestamp
Uri url = new Uri(resourceAssembly.EscapedCodeBase);
long time = File.GetCreationTimeUtc(url.LocalPath).Ticks;
if (time.ToString() != timeStamp)
  thrownew ArgumentException(“Specified resource timestamp is invalid.”);

I just checked with Anakrino to see how the ASP.NET team implemented it in Whidbey. Pretty much the same way. They have done some extra stuff with caching support, which is not included yet.

The new source code is included, so everybody can enjoy the enhancements. Kudos to Ken for adding his bits to the code. You can contact Ken and his band Moments From Impact at

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s