ASP.NET v4.0 Security Update and ISAPI Filters on IIS 6.0

A security patch for ASP.NET v4.0 was released recently.  The details of the patch can be found at http://www.microsoft.com/technet/security/bulletin/ms10-070.mspx. I really only have one thing to say in this blog post:  If you use an ISAPI Rewrite Filter on IIS 6.0 and you’re application pool is using ASP.NET v4.0, then you should disable the ASP.NET extensionless…

4

How to Disable the ASP.NET v4.0 Extensionless URL feature on IIS 6.0

You can disable the v4.0 ASP.NET extensionless URL feature on IIS6 by setting a DWORD at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0\EnableExtensionlessUrls = 0.  After changing the value, you will need to restart IIS in order for us to pick up the change, because it is only read once when IIS starts.  Note that for Wow64 (i.e., 32-bit worker process running on 64-bit…

20

How Extensionless URLs Are Handled By ASP.NET v4

ASP.NET v4.0 has a new feature, when hosted on IIS 7, that enables the execution of extensionless URLs.  This feature has a dependency on a QFE from IIS that enables extensionless handler mappings.  See KB 980368 for more information and a link to download the fix. ASP.NET v4.0 adds extensionless handler mappings to IIS’s configuration file (applicationHost.config).  There…

6

Performing Asynchronous Work, or Tasks, in ASP.NET Applications

In this post I hope to clear up some misconceptions about the use of threads in ASP.NET applications so that you know the best way to perform asynchronous work in your ASP.NET applications.  If you’re in a hurry and don’t want to read the rest of this, then I suggest that you use PageAsyncTask to…

27

How ASP.NET MVC Routing Works and its Impact on the Performance of Static Requests

Recently a number of people have asked how MVC and ASP.NET routing impacts the performance of static requests (HTML, JPG, GIF, CSS, JS, etc).  I’ll answer that question below while explaining how routing is implemented in the ASP.NET pipeline on IIS 6 and IIS 7.  This applies to both ASP.NET 3.5 and 4.0, unless otherwise stated. …

18

Correct use of System.Web.HttpResponse.Redirect

Try very, very hard to avoid using Response.Redirect(url), instead, use Response.Redirect(url, false).  Response.Redirect(url), after writing a 302 redirect response to the response buffers, calls Response.End.  This is very expensive.  The alternative, Response.Redirect(url, false) is fast, but unlike Response.Redirect(url), the lines of code which follow the call to Response.Redirect(url, false) will be executed.  More on this later, but…

11

Obtaining more information from an HttpException

ASP.NET throws HttpException for numerous types of errors, making it difficult to determine exactly what went wrong programmatically. You can parse the error message, but the message can be localized, and therefore parsing it can be non-trivial.  There is, however, a way that you can identify a few specific types of errors. In v2.0 there is an internal property on…

1

Using IIS 7.0 Dynamic Compression with ASP.NET Output Cache

This post discusses an efficient way to compress content served by the ASP.NET output cache.  In .NET Framework v2.0 SP1, included with Windows Server 2008, the ASP.NET Output Cache includes a new feature that allows cached responses to vary by the response’s Content-Encoding header.  And IIS 7.0 has efficient compression algorithms for gzip and deflate.  Put the…

5

ASP.NET Cache can notify you before an entry is removed

.NET Framework v2.0 SP2, which will be included with .NET Framework v3.5 SP1, is scheduled to release this summer.  This release contains a long awaited ASP.NET Cache feature, which will notify you when an entry becomes invalid and leave the stale entry in the cache while you generate a replacement in the background.  Therefore, requests…

2