Friday, September 10, 2010

Using WinDBG to debug .NET 2.0+ applications

To analyze memory dumps of applications using .NET 2.0 and above use the following command:
".loadby sos mscorwks"

This command loads SOS for .NET Framework 2.0.

WinDBG/SOS Cheat Sheet

Update 06/10/2011:

For .NET 4 use ".loadby sos clr"
(source :

Friday, September 03, 2010

WCF InstanceManagement Summary

In WCF, the service instance is a product of binding, contract configuration (SessionMode property on ServiceContract) and service behavior (InstanceContextMode on ServiceBehavior).

The following table summarizes this:

BindingServiceContractAttribute.SessionModeInstanceContextModeAsync Dispose()Service Instance Mode

(behavior of service instance)
TCP, IPCAllowed/RequiredPerCallNoPerCall
WS (no security,no reliability)Allowed/NotAllowedPerCall/PerSessionYesPerCall
WS (with security or reliability)Allowed/RequiredPerSessionYesPerSession
WS (with security or reliability)NotAllowed (setting valid because WS implements application level session)PerCall/PerSessionYesPerCall