• Uncategorized

    Watch out your Web Events!

    In ASP.NET 2.0 we have a new powerful monitoring feature called “Web Events” which help keep track of important events happening during your application’s lifetime, such as the application is starting, is stopping, it has been recompiled, exceptions etc… Web events are consumed by providers (listeners), which read the information packaged with the event and then record the information. Each provider is written to record the Web event data in a different way. For example, one provider might write to the Windows event log, while another might send an e-mail message. We have several built-in Web Events and 3 Providers available, and of course you can build your own using the classes provided in the System.Web.Management namespace; however there are only two events enabled in the rules element: All Errors and Failure Audits. Both are enabled and are subscribed to by the EventLogProvider. In it’s simplest form, for example, you can tell ASP.NET to make an event log entry each time an application starts or shuts down by adding this to the <system.web> section of the web.config file for the application: <healthMonitoring enabled="true" heartbeatInterval="0"> <rules> <add name="Lifetime event logging rule" eventName="Application Lifetime Events" provider="EventLogProvider" /> </rules> </healthMonitoring> The sample code…

  • Uncategorized

    Unable to attach to process (on localhost)

    Another interesting one I got a few days ago: after installing the SP1 for Visual Studio 2003, the customer was unable to debug his web application (on localhost) neither pressing F5 nor attaching to the target w3wp.exe process. As you can imagine, removing SP1 the problem disappeared. Moreover they had multiple machines running the same OS and software that worked fine, only one particular machine was affected by this problem; more interestingly, other developers were able to remotely debug their application hosted on the affected server, so only debugging on localhost was not working (WinForm debugging was also working fine). Of course the account used to login on the server was a local administrator. The target platform we were running on was Windows Server 2003 R2 x64 on AMD Operton 280 (dual core, 2.4GHz) with 4GB RAM; IIS is configured to run in 32 bit mode (w3svc/AppPools/Enable32bitAppOnWin64 = TRUE), and of course Visual Studio .NET 2003 with Service Pack 1. To start troubleshooting this I did a quick research in our internal docs and it turner out that his is a known issue due to loopback check; basically the reason is because the underlying DEBUG request is getting a 401 response, causing the…

  • Uncategorized

    Sweet sorrow… remote debugging (and more)

    Continuing from my previous post on common causes for memory leaks, remote debugging is another ASP.NET feature that has the potentiality to either delight (uhm… am I exaggerating here…? 😉) a web developer or drive him completely crazy 😁 I remember 8-9 years ago, when I was a young technology passionate learning the basics of web development (HTML, CSS, ASP etc…), on my desk I just had a couple of programming books for beginners, my dial-up modem to download some online manuals and my copy of Office 97 for students. My editors at that time were FrontPage 97 and Notepad… so all I could do to debug my web pages were to use lots of Response.Write() to inspect variable values, and lot of brain work to try to understand where things were going wrong… With ASP.NET and Visual Studio .NET in these days developers still have to do lot of brain work, but for sure the tools now help a lot with debugging web applications… but what happens if the debugger has tantrums? 😲 Here is a list of the common debugger problems I saw so far in my experience with Microsoft Support; this is not at all a comprehensive…

  • Uncategorized

    Quick things to check if you are leaking your memory

    After a couple of years working in InternetDev support I’ve seen many different kind of problems reported by customers (different environments, different use of Microsoft technologies and products combined together, different application needs, different customer’s background and technical knowledge etc…), but as one of my favorite authors said, Sometimes they come back, so it happens that sometimes we also get incoming calls for well known problems like memory leaks, high CPU and worker process crashes. Of course there could be many different causes for those problems, but some of them are more likely to affect your application; here is a list of the first things I check when I’m working on a memory leak problem (usually analyzing a memory dump of the faulting application). This is not a complete list (but I promise to update the post if I’ll find something new and interesting) and if you talk to other Support Engineers they might give you a slightly different view on the subject, this is what I found and learnt in my day to day support experience. Application deployed in debug mode This is something we must avoid in a production environment; debug mode is useful during development, but in…

  • Uncategorized

    Watch your symbols!

    This morning I had an open discussion with a customer regarding symbols and their importance in our job (our intended also as a developer, not just as a support specialist). This customer sent in a dump for a memory leak problem he has in his web site (ASP.NET with COM components, calls to Web Services etc…). I have to admit that a few times in the past I went through a dump without any symbols for the application (luckily I always have access to both internal and external symbol server for the OS, .NET Framework etc…), and even sometimes I’ve been able to find the cause of the problem anyway (sometimes it’s quite obvious, it you have memory fragmentation, debug=”true” in web.config, too many dynamic assemblies caused by XML/XSLT stuff etc…), but there are occasions where the call stack is completely messy and the real problem quite hard to discover. Also more important is to have matching symbols: debugging with non-matching symbols could be much worse than debugging without symbols at all, and the analysis could take a completely wrong direction, wasting time and efforts without helping sorting out the problem… and you’ll get a bad support experience when you’ll call us to ask…