Troubleshooting ASP.NET using Filemon
ASP .NET Support Voice Column: Troubleshooting ASP .NET using FilemonTo customize this column to your needs, we want to invite you to submit your ideas about topics that interest you and issues that you want to see addressed in future Knowledge Base articles and Support Voice columns. You can submit your ideas and feedback using the Ask For It (http://support.microsoft.com/common/survey.aspx?scid=sw;en;1176&p0=&p1=&p 2=&p3=&p4=) form. There's also a link to the form at the bottom of this column.On This PageINTRODUCTIONHello again and welcome to the December '04 edition of the Support Voice Column. Once again, I would like to thank Jim Cheshire, a support engineer here at Microsoft supporting ASP .NET, for his contributions. Jim has great ideas for the Support Voice column and wanted to continue to share them. Look for Jim's contributions last month and over the next month or so, and as always, send us your suggestions for future columns. Thank you Jim!
Jim has been working with Microsoft for six years on the FrontPage, VB, and ASP .NET teams. During that time, he has written for the Office Developer Center on MSDN, and he is the author of a book on FrontPage, Special Edition Using Microsoft Office FrontPage 2003. Jim also has a Web site where he provides free add-ins for FrontPage to enable Web developers to make the most out of Microsoft products. Here is that website address: http://www.jimcosoftware.com (http://www.jimcosoftware.com) So please pull up a chair, kick the shoes off, and read through our column all about Troubleshooting ASP .NET ,and remember, you can submit your ideas to us using the "ASK FOR IT" link included in every column we publish. Jeremy Troubleshooting ASP .NET using FilemonLast time I covered how to use Network Monitor and Fiddler to troubleshoot authentication issue with ASP .NET. This month I’ll cover troubleshooting file-access problems using Sysinternals’s Filemon, a tool that is available free from Sysinternals's Web site: http://technet.microsoft.com/en-us/sysinternals/default.aspx (http://technet.microsoft.com/en-us/sysinternals/default.aspx) Here’s the scenario we’re troubleshooting. ScenarioWhen users browse to your ASP.NET application, they see your custom error page. You aren’t sure what the error is, but you know that your application is writing data to a file with the details of the exception. Unfortunately, when you check for the file, it’s not there.Whenever I have written an application that should be writing information to a file and nothing gets written to the file when it should, I assume a permissions problem. There are many ways that you can check permissions. You could just open up the Windows interface and look at the permissions there. The downfall to that method is that you are really only seeing the permissions for the specific object you are examining. If that object is a folder, the permissions may be correct at the folder level and wrong on a file within that folder. Another way to monitor permissions is to audit object access. Auditing works great if you want to take the time to set it up. However, in the scenario we are working with in this article, there is a much easier way to tell if a permissions problem is preventing our user from accessing the file system: Filemon. When you download Filemon from Sysinternals, you’ll get a small .zip file containing three files, one of which is Filemon.exe. That’s the only file you need to use Filemon, so unzip that file to your desktop or some other convenient location. Double-click Filemon.exe to start Filemon. Once you start Filemon, you’ll see it start to fill up quickly with data, as shown in the following image. ![]() What Filemon DoesFilemon logs all file access on your computer. It logs the process that is accessing the file, the type of access that is requested, the path and file name of the file accessed, the result of that file access, and other information of interest. In most cases, the default Filemon settings are sufficient, but if you explore the interface, you’ll find that Filemon includes some powerful configuration options.The trick to using Filemon for troubleshooting a permissions problem is to try and capture the least amount of data necessary and still capture the problem. You can do that easily using CTRL+E, a keyboard combination that toggles Filemon’s capture mode on and off. After you’ve started Filemon, press CTRL+E to stop it, and then press CTRL+X, which will clear the output window. Now you are ready to capture the file access problem. Here’s how you would capture a Filemon log.
Analyzing Data in FilemonIf you choose to analyze the data in Filemon, you might want to use Filemon’s highlighting feature to make it easier to detect a failure. On the Options menu in Filemon, click Filter, click Highlight, and then type ACCESS DENIED in the Highlight textbox, as shown in the following image.![]() ![]() This is a good example of a common scenario that we see in Microsoft Product Support Services (PSS). Some kind of exception has occurred, which has then called into your exception logging code. Your code is supposed to be logging exceptions in a text file, but when that happens, another exception occurs because the process account cannot create the logging file. If you think about what happens next, you’ll see just how bad this is. You’ve just gotten yourself into infinite recursion, and the end result will almost certainly be a crash in the ASP.NET worker process due to a stack overflow. To make matters worse, none of your exception logging ever happened, so you are going to have a tough time tracking down what caused the crash when it occurs. We see these issues often, and unless you understand how to do post-mortem debugging, you are likely going to make yourself bald trying to figure out what’s going on. Fortunately, we provide you with an extremely robust toolset for debugging an ASP .NET application post-mortem, and it just so happens that I’ll be covering that topic in next month's article! I’ll see you back here next month when I’ll teach you how to use Windbg and the SOS extension to analyze crash dumps. Until next time,
Jim Cheshire Support Engineer Microsoft Developer Support As always, feel free to submit ideas on topics you want addressed in future columns or in the Knowledge Base, using the Ask For It (http://support.microsoft.com/common/survey.aspx?scid=sw;en;1176&p0=&p1=&p 2=&p3=&p4=) form.
| Article Translations
|
Back to the top


