From Unhandled Exception to Debugger Attach

I was always wondering what is happening between an application throws an unhandled exception, and a debugger attached to the process. Apparently the information is right under my nose, but I was blind. Windows Debugger’s documentation about post-mortem debugging has all the details you want to know. Enabling Postmortem Debugging The most common application errors…

1

Assembly Loading and Authorization

CLR does not do anything special regarding authorization during assembly loading. It will try to access the file under the current user. However, if an assembly is already loaded, next time when the assembly is requested, CLR will return the assembly from the cache without hitting the file. When the application impersonates a user, things…

0

Mismatched PDBs — Why?

If you are developing software, most likely you have encountered the “mismatched pdbs” debugger error. It usually happens when you point the debugger to the wrong symbol path. But there are times you are confident that the symbols you point to are the correct symbols, and it left you wondering why the debugger believes the…

5

Windows Vista Sxs Activation Context Cache

Sxs activation model is built on top of Actication Context. To create an activation context, use the API CreateActCtx. Activation Context is used very frequently in Windows. For example, a simple operation like start notepad, open the common file dialog, select a file, will call CreateActCtx many times (I measured 18 times in Vista). With…

6

Configuring IIS to Run 32-bit or 64 bit Applications on 64-bit Windows (IIS 6.0)

I was trying VMWare Server on a 64 bit Windows Server 2003 machine to see if I can use it to create a 64 bit guest OS. It did not work. My CPU does not have the magic bits. So I uninstalled it. However, my 64 bit Virtual Server stops working. The administration web page…

2

MiniDumpAuxiliaryDlls and KnownManagedDebuggingDlls

 I accidentally stumble on these two registry keys. And the expert in Windows Debugger team answers my question. —–Original Message—–From: Subject: RE: managed minidump Auxiliary DLLs are loaded inside of MiniDumpWriteDump when it finds a registered auxiliary DLL for a module in the target process. The lookup is to take the full path of the…

1

Loading CLR DAC dll from a different path

From .Net framework 2.0, CLR creates a debugger helper dll mscordacwks.dll. The dll is used by Windows Debugger to enumerate CLR data structures. Mscordacwks.dll is part of .Net framework redist. C:\Windows\Microsoft.NET\Framework\v2.0.50727>dir mscordacwks.dll  Volume in drive C is Vista  Volume Serial Number is C84C-2424  Directory of C:\Windows\Microsoft.NET\Framework\v2.0.50727 07/10/2007  04:38 PM           812,544 mscordacwks.dll                1 File(s)        812,544…

2

The Unusual Ref/Def Mismatch FileLoadException

One of my colleagues has experienced a very strange Ref/Def Mismatch FileLoadException (The located assembly’s manifest definition does not match the assembly reference). After a long investigation, we finally track down the cause. To explain the problem, we have to understand the sequence of assembly loading and the interaction between fusion and CLR. The  key…

1

The sequence of interactions between CLR loader and fusion during Assembly.Load

The following describes roughly the sequence of interactions between CLR loader and fusion during Assembly.Load() in .Net framework 2.0. 1. User calls Assembly.Load. 2. Loader pass the assembly reference to fusion. 3. Fusion checks to see if the assembly has already loaded. If it is, the assembly is returned. 4. If not, fusion probes the…

3

advantages and disadvantages of delay load (LoadLibrary)

Some knowledgeable people posted the following wisdom about delay load. Archived here to share.    The advantages are that dlls get loaded only when they are used, and you can “statically” bind to an import that may not exist at runtime, and as long as you are careful not to call it, the program will…

3