• Uncategorized

    Help, my application crashes! No, it hangs… Uhm… we get a strange error… What…?!? (the importance of a proper problem description)

    Dealing on a daily basis with customers and the problems they encounter using Microsoft technologies and products, and having to help them troubleshoot and resolve those problems, specially at the beginning of a new support call (after I pick the case up from the incoming queue and put it in my wipbin, as it’s called my personal queue in our CRM software) I  call the customer to discuss about the problem and to get a detailed overview of the faulting application, the environment where it’s running (or it is supposed to run), the error they get, under which circumstances they get it (under load picks, any specific operations going on at that time on the server, any reproducible behavior by one of the clients…), side effects (high memory, high CPU, performance slowness…), how they (at least temporarily) get rid of it (recycle the application pool, iisreset, recompile…). in those situations, quite often I end up asking almost the same questions to every customer to start building a picture of the situation, and when I think I have this quite clear in my mind I can elaborate an action plan to start digging into the situation questing for the bad guy.No need to say…

  • Uncategorized

    Don’t slide your expiration without cookies!

    This week I’ve been working on a problem which at the beginning seemed to be just a matter of configuration but that then took some more time that I expected to resolve… so, here it is. In my ASP.NET 2.0 application I edit my web.config to set slidingExpiration=”true” and cookieless=”true” in Forms authentication. Basically what happens is that after half of the timeout set in <forms> element is elapsed, the user is redirected to the login page; e.g. I set <forms timeout=”3″ cookieless=”UseUri” enableCrossAppRedirects=”true” /> (timeout 3 minutes), if I postback the page after 1 minute and 35 seconds, I’m redirected to the login page (but the Forms authentication ticked should still be valid…). This can’t be a cookie problem because we are not using cookies… First, a quick review of sliding expiration: “When the SlidingExpiration is set to true, the time interval during which the authentication cookie is valid is reset to the expiration Timeout property value. This happens if the user browses after half of the timeout has expired. For example, if you set an expiration of 20 minutes by using sliding expiration, a user can visit the site at 2:00 PM and receive a cookie that is set to expire…

  • Uncategorized

    Find which application pool is hosting your application

    If you have an IIS 6 with multiple application pools running, and you need to know which w3wp.exe process is actually hosting your application (suppose you have to capture a dump and don’t want to use the “-iis” switch with adplus, which will produce one dump file for every w3wp.exe, dllhost.exe and for inetinfo.exe), then follow these steps to find out: Using the IIS Manager, note down the Name of the App pool for your application In the command prompt, go to <WindowsFolder>System32 Type the following command: iisapp.vbs /a <AppPoolName> (Use double quotes around the name if it has a space) The result will contain the Process ID for your application pool The greatest mistake you can make is to be continually fearing you will make one. – Elbert Hubbard 

  • Uncategorized

    Visual Studio 2005 hotfixes made public for download

    After reading this post a while ago regarding the availability Policy for some hotfixes (e.g., not all hotfixes are public for download, and you have to call Microsoft Support to obtain the one you need), I had an internal discussion with my team on this topic. Basically those are some of the reasons (at least the one I know about) for this controversial choice: As stated in every KB article, those fixes have not gone through the same accurate testing as public fixes or Service Packs, so it’s possible that with a particular configuration the fix a customer request is not the right approach for him We keep track of the hotfixes we send to customers, and if a bug or problem is later discovered in that particular fix, thanks for those records we know who has installed it and we are able to contact those customers to send them an updated version of the patch, or in any case inform them of the newly discovered problem and help them to avoid it More often than you can imagine, we receive clearly wrong hotfix requests: for instance, a particular exception in Framework 1.0 has been fixed and the KB article is still…

  • Uncategorized

    Code Access Security hosting control in IE

    PROBLEM You have a Windows Forms component hosted in Internet Explorer, and you want to catch events raised by this control from client side scripting; to avoid security errors at runtime, the control must have “Allow calls to unmanaged assemblies” permission. if you do this, you’ll notice that this works only if you  give this permission to the whole Zone or Site, but does not work if you give it just to the Assembly or the URL. REASON The reasoning behind the security exception is AppDomains. Before IE can load your assembly, it must create an AppDomain to load the assembly into. When it creates this AppDomain, it assigns all the evidence it knows without loading your assembly, the Site and Zone that it is loading from. Since the AppDomain itself does not get any evidence about the signature that your assembly has (it can’t since the assembly is not loaded yet), it will not match the code group that you created giving extra trust. Now when a security demand occurs, a stack walk begins. When your assembly is checked for correct permissions, it passes, and the stack walk continues until it gets to the AppDomain. Since the AppDomain doesn’t…