A number of people have had difficulty debugging a .NET Framework 2.0/3.0/3.5 class library that loads into a native executable. The debugger will launch, and their code will run, but the debugger will not stop at breakpoints, detect that modules load, etc. The problem is that the debugger is trying to determine what version of…

Recently, I spent a while digging into a managed memory leak. This is a pretty well-worn blog topic, but I figured I would add my two cents to it anyway, as I found a few things that I didn’t notice in the existing blogs. First, Rico wrote up the basic approach back in 2004, so…

To date, one difficulty with implementing COM interfaces in managed code is that until now there has been know way to debug into QueryInterface. With CLR v4, its now possible to modify your object to trace calls to QueryInterface using the new ICusomQueryInterface interface (see MSDN). Example: [ComVisible(true)] sealed class MyObject : IMyInterface, ICustomQueryInterface…

In my little corner of the world, during the last year (give or take) Hyper-V went from something that a few people were playing with to something that every single person couldn’t live without. The huge benefit to us is the ‘snapshot’ feature, which allows us to instantaneously get a test machine back to clean…

Visual Studio 2008 shipped with a feature to automatically enable script debugging when starting IE8 from Visual Studio. In other words, if you are using VS 2008 and IE8, there is no longer a need to tweak IE options to debug your site. However, this feature unfortunately created a problem which we didn’t notice before…

[Note: This post has been updated with new information] There is currently an issue in VS 2005 after you install IE8 where script debugging is broken. If you are using VS 2008, this will not be a problem. Brad Sullivan posted the work around in the debugger forum. Here is what he said: IE 8 has…

We recently had some questions on our internal Visual Studio Debugger forum about the exceptions dialog. So I decided to take a stab at explaining it. Just My Code The first step to understanding this dialog is to understand a feature called ‘Just My Code’ (enabled/disabled with ‘Tools->Options->Debugging->Enable Just My Code’). Just My Code…

Sometimes you need to debug a process, and you need to attach the debugger right away, but you cannot launch the process under the debugger. For example, if the process you need to debug is a Windows Service, the Windows Service Manager must launch the process. How can you debug it? Here are the two…

Today’s blog is about writing your own script debugger. Visual Studio has provided ‘Script’ debugging for a long time. In this context, ‘Script’ refers to script run by jscript.dll or vbscript.dll such as the script code in Internet Explorer, classic ASP scripting, or the cscript/wscript programs. Long long ago, someone provided a sample for creating…

Background Sometimes Visual Studio crashes. It would be nice if this wasn’t the case, but unfortunately it happens. However, like many Microsoft applications, Visual Studio has Error Reporting so that when a problem happens, you can tell us about it in one click. However, sometimes you would like to actually tell a live human about…