Showing posts from November, 2012

Windbg SOS CheatSheets

A Couple of Cheatsheets (reference: and

Cheatsheet #1

Starting, Attaching, Executing and Exiting
Start -> All Programs -> Debugging Tools for Windows -> WinDbg F6 attach to process Ctrl-Break interrupt debugee .detach detach from a process g continue debugee execution q exit WinDbg

Getting Help

SPSolutionExport Exception SecurityTokenService.Issue()

In trying to save a site using the Site Settings -> Save as Template, I received the following error:

11/15/2012 15:57:26.84  w3wp.exe (0x1A64)                        0x1944 SharePoint Foundation          General                        c42u Monitorable SPSolutionExporter: System.InvalidOperationException: The Writer is closed or in error state.     at System.Xml.XmlWellFormedWriter.AdvanceState(Token token)     at System.Xml.XmlWellFormedWriter.WriteEndElement()     at Microsoft.SharePoint.ScopedXmlWriterElement.Closer(XmlWriter writer, ScopedObjectUsage`1 wrapper)     at Microsoft.SharePoint.ScopedObjectUsage`1.Dispose(Boolean isDisposing)     at Microsoft.SharePoint.ScopedObjectUsage`1.Dispose()     at Microsoft.SharePoint.SPSolutionExporter.ExportContentTypes(SPContentTypeCollection contentTypes, String partitionName)     at Microsoft.SharePoint.SPSolutionExporter.ExportLists()     at Microsoft.SharePoint.SPSolutionExporter.GenerateSolutionFiles()     at Microsoft.SharePoint.SPS…

Using WinDBG to Debug SharePoint & Cheatsheet

Loading SOS
For sometime now I have relied on windbg to show me exceptions occuring in SharePoint.

You can attach windbg to any process and view the .NET exceptions occuring at runtime between the process and the CLR, even handled exceptions.

Usually the true source of the error is hidden in a wrapper and rethrown as an irrelevant exception. Thank you SharePoint.

In order to view these exceptions we can attach windbg to either the w3wp.exe related to your IIS website running the SharePoint site by clicking Start => Run => inetmgr => Click on server => Worker processes, or by powershell if you are executing or can execute the relevant command through powershell you can attach the to powershell.exe process.

After launching windbg and attaching to a process we need to load the Sons of Strike SOS.dll to enable viewing managed exceptions in windbg, without the SOS dll we can only view native code.

To do this within the windbg command prompt of the attached process type:

For .N…