• Uncategorized

    MaxConnection does not have effect on ASP.NET 2.0

    An interesting change which you might have missed in .NET 2.0 is about the autoConfig setting for the <processModel> element. The customer was running out of available connections while accessing a remote web service and was trying to apply what’s suggested in Contention, poor performance, and deadlocks when you make Web service requests from ASP.NET applications but apparently the change had not effect: a memory dump shown still 12 available connections even if he set MaxConnection=96. Interesting to note that reverting the application to .NET 1.1 the problem disappeared. The different behavior is determined by the autoConfig value, which affects only ASP.NET applications and not Console, WinForm etc… (while the <processModel> threading configuration in .NET 1.x affected all .NET apps running on the machine): Specifies whether to automatically configure the following settings to achieve optimal performance based on the machine configuration:The maxWorkerThreads attributeThe maxIoThreads attributeThe minFreeThreads attribute of the httpRuntime element.The minLocalRequestFreeThreads attribute of the httpRuntime elementThe maxConnection attribute of the <connectionManagement> Element (Network Settings) element. The values are set according to the KB article at http://support.microsoft.com/?id=821268.  This attribute does not affect the .NET Framework client applications; only ASP.NET applications. The autoConfig attribute can be one of the following values. True: Indicates that ASP.NET automatically configures…

  • Uncategorized

    Web Garden, AppDomain, statics… when Sql Server is not enough to save your session

    Things have gone a bit crazy lately, we’ve been under a huge workload and the time left for blogging was virtually non existent… but the good thing is that I’ve been working on a few interesting cases I hope I’ll have time to blog about, and this is the first one. The problem The application was running on a Windows 2003 cluster and the well known solution to avoid session problems in a multi server environment is to store user sessions out-of-process, either using a State Server or Sql Server, and in this case we were using Sql Server; this is also the right approach if you are using Web Garden for your application pool and this is the situation we were in (web garden + state on Sql Server). But some session-wide arrays the customer was using were suddenly empty as soon as the customer increased the number of worker processes above 1 for the application pool, which is exactly what is not supposed to happen with <sessionState mode=”SqlServer” … />. At the beginning I thought to a configuration problem on the affected servers but the usual quick check on the metabase shown that was not the case, so…

  • Uncategorized

    And when you think there’s nothing left to do… you can still debug live

    There are circumstances where taking a dump is not possible or simply not convenient; imagine a situation where you’re hunting a nasty exception you don’t know where it comes from and you need to follow some complex steps to get there, or when you have dozens of that exception (let’s say an Access Violation) but you’re interested in a specific one you get only when on click on a specific button, or after you paginate long enough through a GridView (and of course you don’t want dozens of full dumps, 1 Gb each), or if you’re hunting for some security related problem and you need to inspect the security token your thread is using in a particular moment (something I did here) etc… For sure if you ask Doug he’ll have dozens of good answers to this question ? Getting started Let’s assume you already have correctly setup your Windbg workspace, symbols etc…, then you can go from File > Attach to a process… (or hit F6) to get the Attach to process dialog below: Note that if you expand the tree for your target process you’ll see some information about the process’ session, this is useful if for example…

  • Uncategorized

    Unable to use SQL Server because ASP.NET version 2.0 Session State is not installed on the SQL server

    I run across this error today while setting up a repro for a problem I’m working on; the first time I through I did something wrong between the mess of things which case across my hands today (maybe I’ve used the wrong .sql script? ?), but after removing the database from Sql Server and re-running correct InstallSqlState.sql, I got the same message once again ?. Ok then, time for a (hopefully) quick research on this error and finally I found out a few things which might cause it. Running  both ASP.NET and classic ASP in the same application pool? If the application pool is also running classic ASP pages, and those classic ASP pages use .NET 2.0 components, and those classic ASP pages which use .NET components are called before any ASP.NET 1.1 page, then we’ll load CLR 2.0 (first come, first serve ?) and of course it will look for his specific ASPState version. Ok, there are a lot of “if” in this case, but it’s still a possibility… not my scenario, through. Where are your session tables? If you use aspnet_regsql wizard, session tables are not added by default so you need to run the following command: aspnet_regsql.exe…