• Uncategorized

    Ajax resource intermittently not accessible (http compression)

    A few days before Christmas I had a case where the customer was intermittently getting troubles with his javascript/Ajax resource; as usual everything was working fine on the development machine, but when moved on the production server the application started throwing some client side javascript exceptions like “myVar is undefined” which means that the Ajax resource was not accessible by the browser. After some of the usual checks and discussions with the customer we found out that the production server was using HTTP Compression which is an old friend of mine (I already rambled about it here); they developed a custom HTTP Module to implement the .NET Framework compression classes and mechanism and disabling it was not an option, since their resource were quite large were affecting the applications’ performance. Then I had a couple of weeks off for Christmas and my colleague Gunnar took over the case (isn’t nice when you go on holiday and someone else takes care of the job for you? ?) and with some further debugging they found this interesting method: private static bool IsCompressionEnabled(HttpContext context) { return ScriptingScriptResourceHandlerSection.ApplicationSettings.EnableCompression && ((context == null) || !context.Request.Browser.IsBrowser("IE") || (context.Request.Browser.MajorVersion > 6)); } This means that Ajax does…

  • Uncategorized

    Corrupt installation? Do not repair Visual Studio

    (Unable to start debugging on the web server. An error occurred that usually indicates a corrupt installation. If the problem persists, repair Visual Studio installation via ‘Add or Remove Programs’ in Control Panel) I saw this happening on a Vista x64 while trying to debug an ASP.NET application and needless to say (☹️), repairing Visual Studio does not help. This is a misleading error message which might appear when you try to debug an ASP.NET application on a 64 bit OS and you configured your application pool to run a 32 bit worker process; I know it will be changed to a more meaningful message, but I’m not sure about the timeframe (I can’t repro so I’m not able to check how Visual Studio 2008 behaves). What to do then? Check the advanced settings for your application pool and set “Enable 32-bit applications” to “False” By the way, I was this error in conjunction with this one so pay attention if you’re hitting one of the two… Carlo Quote of the Day: Sincerity is the highest compliment you can pay. –Ralph Waldo Emerson

  • Uncategorized

    The error indicates that IIS is not installed on the machine. Please install IIS before using this tool

    Yesterday I was working on a sample project got from a customer, when Visual Studio 2005 showed this dialog: Ok I thought, let’s fix the application mappings. I did, but got the following: What? Are you kidding me? ? Of course IIS is installed, I’m using it every day… But wait a minute, I’m running on Vista x64 and this rings a bell to me… Let’s use the x64 Visual Studio command prompt and give it another try: Much better… and now Visual Studio does not complain anymore! ? Carlo Quote of the day: We are inclined to believe those whom we do not know because they have never deceived us. – Samuel Johnson

  • Uncategorized

    HTTP error 406 with .NET Framework 3.0

    I got a couple of cases about this problem recently… Imagine this scenario: you install the .NET Framework 3.0 on your client, and then browse an ASP.NET based web site; you get a 406 HTTP return code from the web server, which means “Client browser does not accept the MIME type of the requested page” (see IIS status codes). Uninstalling the .NET Framework 3.0 corrects the problem, and you’re finally able to successfully browse the site. The problem proved itself in two different ways and apparently for two different reasons, but the underlying cause was actually the same. The 406 return code also means that any of the configuration limits has been reached, and digging into IIS logs we found that the problem was actually due to the length of the “Accept” header which has a limit of 256 bytes. Installing the .NET Framework 3.0 you receive support for a few additional file formats, here is how it looks the Accept header on Windows Vista (where the .NET Framework 3.0 is preinstalled): Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */* In this case there was a custom ISAPI extension which was actually filtering the…

  • Uncategorized

    Server Error 500, unable to create new session

    I saw this problem reported on a Windows 2000 Server (IIS 5.0), I’ve not checked if the same could also happen on IIS 6/7… The application is build on classic ASP pages and the error appeared about once per day on a test server; when browsing the user got a message reading "unable to create new session" (rough translation from Italian), and when this happens the only solution was to reset IIS (while in that status, even static HTML content was not served). Interestingly the Event Log showed quite a few entries like the following: Event Type:  Warning Event Source: COM+ Event Category: Activation Event ID:    4238 Date:        03/07/2007 Time:        11.05.49 User:        N/A Computer:    xxxxxxxx Description: COM+ has determined that your machine is running very low on available memory.  In order to ensure proper system behavior, the activation of the component has been refused.  If this problem continues, either install more memory or increase the size of your paging file.  Memory statistics are: dwMemoryLoad = 98 dwTotalPhys = 536358912 dwAvailPhys = 9453568 dwTotalPageFile = 1945448448 dwAvailPageFile = 48668672 dwTotalVirtual = 2147352576 dwAvailVirtual = 405975040 Server Application ID: {3D14228D-FBE1-11D0-995D-00C04FD919C1} Server Application Name: IIS Out-Of-Process Pooled Applications This turned out to be…

  • Uncategorized

    Visual Studio debugger conflicts on port 80

    I personally got this problem on my laptop a while ago where IIS and Skype where involved, and even if this time the customer reported two different applications involved (Visual Studio 2005 and Cisco IP Communicator), the symptoms where the same: with Visual Studio 2005 and Cisco IP Communicator running ad the same time, he was unable to debug his web application with the message “Unable to start debugging on the web server.  Could not start ASP.NET or ATL Server debugging.  Verify that ASP.NET or ATL Server is correctly installed on the server“. If he stopped the IP Communicator the problem went away; clearly a conflict between IIS and Cisco Communicator. Just to be sure we had a look at “netstat -a -b”, and found (as expected) that both applications were listening on the HTTP port TCP    computername:http     computername.domain.com:0  LISTENING       492 [inetinfo.exe] TCP    computername:http     computername.domain.com:0  LISTENING       3872 [Communicator.exe] Since I don’t know how Cisco IP Communicator works (and we can’t support third party apps anyway), we decided to change the IIS port to 81, but this time the customer was getting “Unable to start debugging on the web server. Unable to connect to the web server. Verify that the web…

  • Uncategorized

    Driver’s SQLAllocHandle on SQL_HANDLE_DBC failed

    Another weird one I got this afternoon. A colleague from the Sql team asked my help about what looked an authentication problem is customer’s web application, while trying to connect to a Lotus Notes database: in short, the customer was developing his application with Visual Studio 2005 and was testing it with Cassini, and everything looked fine, but as you can guess the problem arose when he deployed the site on his test IIS. They got the error [IM005] Driver’s SQLAllocHandle on SQL_HANDLE_DBC failed. The first thought was about a permission problem, since as you may know one of the main differences between IIS and Cassini is that the latter is essentially a process which runs in the context of the account logged on the machine, while IIS is a service which runs under different accounts but with lower privileges. Ok then, to verify this hypotheses we made a quick change to the <processModel> section to have the worker process running under the customer’s account instead of the default ASPNET (he was testing on his local IIS 5.1 on XP). Well… same problem. So that could not be a security problem, ASP.NET was running as an administrator… ? The error…

  • Uncategorized

    Unable to “InitializeSecurityContext”?

    Sometimes having fortune at your side can really save you the day (to say the least), and in developer support it can save you hours (of not days) of troubleshooting… With this premise, a couple of weeks ago I was helping a colleague from the Sql Server support team whom was struggling with an authentication problem one of his customers was having with Reporting Services: basically IIS was prompting them to login to access the application, but even entering the correct credentials those were refused, and after three strikes they were redirected to the standard 401 (unauthorized) page. While waiting for some logs I requested to the customer, I was building a repro for another customer I had at the same time (with a completely different problem, that was a weird runtime exception I’ll likely write about in another post), and one of the requisites was to have the application pool running under a domain account instead of the default NETWORK SERVICE: well… I got the same problem reported by the first customer! ?  It worth mentioning that I was also using Integrated Authentication for the virtual directory, and interestingly, the problem disappeared if I was using a local account…

  • Uncategorized

    Quick hint: “Server Unavailable” error

    I stumbled into this error this afternoon, while working on a repro for a customer: if you need to have your application pool running under an account other than the default NETWORK SERVICE, and when you try to browse your application you get a nasty Service Unavailable error, check if you remembered to add that account to the IIS_WPG group… ? Carlo

  • Uncategorized

    The importance of breaking changes

    Yesterday I closed a case about a migration issue from ASP.NET 1.1 to 2.0. The customer built this application based on ASP.NET 1.1 to generate some PDF documents on the fly on the web server, and stream the content to the client for reading; the application also served as a sort of archive browser, where online users are able to browse a list of archived PDF files. The customer thought carefully to his error handling (I think he did a very good job), and also decided to customize the standard 404 error page to something more friendly and informative for application’s users, so he configured the <customErrors> section in his web.config to point to a specific page to handle the 404 return codes. But he wanted this custom page to be displayed also if the user requested a non existing PDF file, so he had to add a new mapping in IIS console, to have requests for .pdf files go through the ASP.NET execution channel (aspnet_isapi.dll etc…) and benefit of the advanced features (including security and error handling) granted by the .NET Framework. This worked pretty well fos some time, until the customer decided to migrate his web applications to…