What might be causing the “The client disconnected” ASP.NET exception?

The vbdork.net domain seems to now be defunct. In searching on this error, I found several references to this article. So I found a google cached version of it and am now posting it here for reference. The original URL was: http://vbdork.net/post/2009/02/10/The-client-disconnected.aspx You get the message The client Disconnected. You’re likely to sporadically get this … Read more

IIS 6.0 wildcard mapping benchmarks?

Chris, very handy post. Many who suggest a performance disadvantage infer that the code processed in a web application is some how different/inferior to code processed in the standard workflow. The base code type maybe different, and sure you’ll be needing the MSIL interpreter, but MS has shown in many cases you’ll actually see a … Read more

How can I programmatically stop or start a website in IIS (6.0 and 7.0) using MsBuild?

By adding a reference to Microsoft.Web.Administration (which can be found inX:\Windows\System32\inetsrv, or your systems equivalent) you can achieve nice managed control of the situation with IIS7, as sampled below: namespace StackOverflow { using System; using System.Linq; using Microsoft.Web.Administration; class Program { static void Main(string[] args) { var server = new ServerManager(); var site = server.Sites.FirstOrDefault(s … Read more

Display custom error page when file upload exceeds allowed size in ASP.NET MVC

When running under IIS7 and upwards there is another parameter: <system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength=”10485760″ /> </requestFiltering> </security> </system.webServer> The default setting is slightly less than 30 MB. For uploaded files with size between maxRequestLength and maxAllowedContentLength IIS7 will throw an HttpException with HTTP code 500 and message text Maximum request length exceeded. When this … Read more

Programmatically create a web site in IIS using C# and set port number

If you’re using IIS 7, there is a new managed API called Microsoft.Web.Administration An example from the above blog post: ServerManager iisManager = new ServerManager(); iisManager.Sites.Add(“NewSite”, “http”, “*:8080:”, “d:\\MySite”); iisManager.CommitChanges(); If you’re using IIS 6 and want to do this, it’s more complex unfortunately. You will have to create a web service on every server, … Read more