• Uncategorized

    DropDownList with tooltip

    I recently got this question from a customer whom is binding some data to a DropDownList control inside a GridView; the various items inside the DropDownList has variable length while the control itself per their page resign requirements must be fixed, making it difficult to fully read and understand the text associated with the selected item, so the customer asked for some hints to add a tooptip functionality to the DropDownList. Before raising the call he had already searched the Internet but without much luck; I did the same myself and apparently there are plenty of samples showing how to display a tooltip when the mouse is over an item already selected in a DropDown control, but the customer wanted something different: he needed to show the tooltip over each item in the DropDownList before actually selecting them to help users make the appropriate selection. Well, for Internet Explorer 7 (al later) it is possible to use the “Title” attribute for the <option> tag: for (int i = 0; i < GridView1.Rows.Count; i++) { //Add logic to fill the GridView //Now let's iterate through the DropDown controls to add a "Title" to the //resulting HTML "<option>" elements: this will add…

  • Uncategorized

    The show goes on even if I’m on vacation

    … so while I was taking a break from computers to move to a new house (I’m still packing and unpacking things), a few notable things happened: Internet Explorer 8 beta 2 has been released, Google released its new browser Chrome and my colleagues from the Italian Enterprise Support Group have started a team blog! So if you can at least read Italian I suggest you to keep an eye on it, knowing that smart people you can expect a lot of good content from them ? Carlo Quote of the day: I was always taught to respect my elders and I’ve now reached the age when I don’t have anybody to respect. – George Burns

  • Uncategorized

    How many application pools can you cope with?

    This is an interesting question I have to admit I had not thought to until we got a case from a customer whom was in trouble with his production servers: how many application pools can you run on IIS? Event better, how many w3wp.exe instances can the OS cope with? As quite often happens in our job, the correct answer is: it depends… First, the problem. The customer was a hosting company so they had a large numbers of sites on each web server, around 450, each of them with its own application pool, each application pool run under its own specific account and aspExecuteInMTA was set to 1 on each server. Under some circumstances asp applications from some web sites are failing with the following message (roughly translated from Spanish): Server error ‘ASP 0177 : 80070057’ Error in Server.CreateObject /site/page.asp, line 338 80070057 When the problem occurred the customer recycled the two or three top consuming web sites in terms of memory, threads and handles; then the failing web site was usually back online. Note that the failing web site was always only affected by other problematic ones, it was almost never the culprit. At first we were distracted…

  • Uncategorized

    Visual Studio 2008 SP1 and .NET 3.5 SP1 available for download

    Microsoft Visual Studio 2008 Service Pack 1 (exe) This download installs Visual Studio 2008 Service Pack 1 (SP1) and the .NET Framework 3.5 SP1. SP1 addresses issues that were found through a combination of customer and partner feedback, as well as internal testing. These service packs offer Visual Studio and .NET Framework users improvements in responsiveness, stability and performance. Click here for more information regarding about these service packs. Microsoft .NET Framework 3.5 Service Pack 1 .NET Framework version 3.5 Service Pack 1 provides the following new features and improvements: ASP.NET Dynamic Data, which provides a rich scaffolding framework that enables rapid data driven development without writing code, and a new addition to ASP.NET AJAX that provides support for managing browser history (back button support). For more information, see What’s New in ASP.NET and Web Development. Core improvements to the CLR (common language runtime) that include better layout of .NET Framework native images, opting out of strong-name verification for fully trusted assemblies, improved application startup performance, better generated code that improves end-to-end application execution time, and opting managed code to run in ASLR (Address Space Layout Randomization) mode if supported by the operating system. Additionally, managed applications that are opened…

  • Uncategorized

    Charting with LogParser

    A picture worth 1000 words and this is true also when you have to analyze IIS logs to get some statistics on your site; as you already know, LogParser is extremely flexible and very useful in such situation and its chart output format is what it’s needed.The first thing you need is a copy of Office Web Components installed on the machine; if you don’t, LogParser will complain and return this error: Error creating output format “chart”: This output format requires a licensed Microsoft Office Chart Web Component to be installed on the local machine From LogParser help: chartType Values: name of chart type Default: Line Description: Chart type Details: The set of available chart types depends on the version of the Microsoft Office Web Components installed on the local computer. For a list of the available chart types, type the following help command from the command-line shell:       LogParser -h -o:CHART Currently the latest Office Web Components version available (the newest I’ve been able to find on the Internet) is version 11 which has been released for Office 2003. Changes in the 2007 Office System OWC11 Description: OWC11 is removed from the 2007 Office system and now ships only…

  • Uncategorized

    LogParser did it again: application pool recycle

    This started as a “standard” w3wp.exe crash, but this time IIS was also randomly disabling one of the application pools on the server. This is a protection mechanism we have since IIS 6 called Rapid Fail Protection that disables ad application pool (for security and stability reasons) if it fails (encounters severe errors) too often: how often and how much time it’s configurable (see Configuring Rapid-Fail Protection in IIS 6.0), the default is 5 failures in 5 minutes. Looking at the System event log there were plenty of messages like: A worker process with process id of ‘xxx’ serving application pool ‘MyAppPool’ has requested a recycle because it reached its virtual memory limit. And also: A process serving application pool ‘MyAppPool’ exceeded time limits during shut down. The process id was ‘xxx’. How often? As usual, LogParser comes at hand. logparser "select quantize(TimeGenerated, 300) as TimeGen, count(*) as NumberOfrecycles into memory_limit_recycles.log from system.evt where EventID = 1077 and Message like '%\'MyAppPool%' group by TimeGen order by TimeGen" -i:evt -o:nat -rtp:-1 Note the “quantize” function: LogParser help states “Truncates a value to the nearest multiple of another value”; what it actually does in the command above is count the number of…

  • Uncategorized

    Time-taken and LogParser for web site statistics

    The time-taken field is quite handy if your web application or IIS web server is performing poorly (or slower that you expect) or even for simple statistics and monitoring purposes, if you want to keep under how long it takes every web request to be processed and the page sent back to the client. In earlier versions of IIS the time-taken field was not selected by default so I often had to request customers to first enable it, wait some more time for the problem to reoccur (to give IIS the change to create a significant amount of logs with the new value) before being able to start troubleshooting. Well, at least before being able to extract some statistics involving the duration of web requests. Luckily in IIS 7 time-taken is now selected by default so we already it logged and ready to use. Taken from the IIS online docs, here is the meaning each field in IISW3C logs: Date (date) Logs the date on which the request occurred. Selected by default Time (time) Logs the time, in Coordinated Universal Time (UTC), at which the request occurred. Selected by default Client IP Address (c-ip) Logs the IP address of the…

  • Uncategorized

    Visual Studio 2008 crashes in “split view”

    “Split view” is one of the new features in Visual Studio 2008 web designer: this is the possibility to have Design View and Source View of your page at the same time (see What’s New in ASP.NET and Web Development, “Visual Web Developer Enhancements” paragraph). A few days ago a customer called in to report a problem with his Visual Studio and split view: when trying to view a file (even a new one) in split view or design view the IDE either crashed or frozen. As you can imagine we took a crash dump with adplus, but a first look at the threads, stack, exceptions etc… (the usual stuff) did not show anything interesting. Then I thought to some external process (like an antivirus, third parties add-ons etc…) that might meddle in and had a look at the list of modules loaded within the process with lmf (list loaded modules with full path). There where only a couple of odd dlls loaded, from Office 2003: 33f20000 34118000 FPCUTL (deferred) Image path: C:\Program Files\Microsoft Office\OFFICE11\FPCUTL.DLL Image name: FPCUTL.DLL Timestamp: Wed Jun 06 19:44:55 2007 (4666F297) CheckSum: 001EC356 ImageSize: 001F8000 File version: 11.0.8170.0 Product version: 11.0.8170.0 File flags: 0 (Mask 3F)…

  • Uncategorized

    An interesting fusion cache lock: that’s what the GAC is meant for

    This has been an interesting case where we had an ASP.NET 2.0 application which under load was completely blocked after a few minutes. Since we were talking about a hang/deadlock (as reported from the customer), the !critlist command (you can find the command within the SieExtPub.dll extension) is a good start: 0:021> !critlist CritSec at 7a393800. Owned by thread 21. Waiting Threads: 6 7 8 9 10 11 12 13 42 72 104 107 108 109 110 111 112 113 114 115 116 CritSec at e194c. Owned by thread 32. Waiting Threads: 21 Thread 32 holds a critical section and thread 21 is waiting on it, but thread 21 is also owning another critical section, and about 20 other threads are waiting there… so apparently this is not a real deadlock (21 is waiting on 32 but 32 is not waiting on 21); but what is thread 32 doing? 0:032> kpL2000 ChildEBP RetAddr 0327fd30 7c822124 ntdll!KiFastSystemCallRet 0327fd34 77e6baa8 ntdll!NtWaitForSingleObject+0xc 0327fda4 79e718fd kernel32!WaitForSingleObjectEx+0xac 0327fde8 79e718c6 mscorwks!PEImage::LoadImage+0x199 0327fe38 79e7187c mscorwks!CLREvent::WaitEx+0x117 0327fe48 7a0e288e mscorwks!CLREvent::Wait+0x17 0327fe9c 7a086e76 mscorwks!Thread::SysSuspendForGC+0x52a 0327ff88 7a0d867b mscorwks!SVR::GCHeap::SuspendEE+0x16c 0327ffa8 7a0d8987 mscorwks!SVR::gc_heap::gc_thread_function+0x3b 0327ffb8 77e66063 mscorwks!SVR::gc_heap::gc_thread_stub+0x9b 0327ffec 00000000 kernel32!BaseThreadStart+0x34 It is waiting to start GC but it cannot, because thread 95 has PreEmptive…

  • Uncategorized

    autoConfig=”false” effects

    My post on autoConfig triggered and interesting discussion with my colleague Cenk about which is the real effect of this setting; one of his customers asked what to do if they needed to adjust only one or two values and not all the ones discussed in Contention, poor performance, and deadlocks when you make Web service requests from ASP.NET applications, they wanted to be sure they could change only what they needed to fine tune and forget about the rest. The short answer is: you can change only what you need to and leave he rest as is, since we have default values hardcoded to improve performance so you’re safe (provided the values you’re changing make sense in the context, of course). If we have a look at System.Web.Configuration.ProcessModelSection with Windbg, we can see all the properties we have in <processModel> and _defaultValue corresponds to the defaults we have in machine.config.comments: 0:000> !do 06904868 Name: System.Web.Configuration.ProcessModelSection MethodTable: 6638dcb0 EEClass: 663a0604 Size: 64(0x40) bytes (C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03f5f7f11d50a3a\System.Web.dll) Fields: MT Field Offset Type VT Attr Value Name 7910be50 400014d 30 System.Boolean 1 instance 0 _bDataToWrite 7910be50 400014e 31 System.Boolean 1 instance 0 _bModified 7910be50 400014f 32 System.Boolean 1 instance 1 _bReadOnly 7910be50 4000150 33…