Smiling Bald Guy

Solving the world's problems using code (that honestly could use a few more unit tests).

Managed Minidump Debugging – now with Source Server support!

with one comment

I recently set up a source and symbol store for my employer, and was dismayed to discover that our shiny new source server (which really isn’t a “server” per se, but that’s another post…) wasn’t working when I opened a minidump captured from a managed -code process. Instead, you are presented with the standard “Browse to the source code” dialog, which is nigh useless in a production build server environment. If you enable Source Server debugging in the output window, you’ll see messages like

SRCSRV: The module ‘<<path to the exe file>>’ does not contain source server information.

Which is patently false; using srctool on the PDB shows that the source control command is being populated.

Luckily, Microsoft has the Visual Studio feedback site, and believe it or not:  they actually pay attention to the feedback! It took some explanation and a detailed set of repro steps, but within a month (bear in mind this was over the Winter holiday season) an MS SDE got me a workaround. I’ll include his response verbatim here:

The root cause is the managed debug engine tries to verify that each source server enabled assembly is running as a fully trusted assembly from the CLR’s perspective. Unfortunately, it calls several APIs in the CLR when doing so that the CLR does not implement while dump debugging. There is a workaround by disabling this feature using a debugger metric. To do so, add a new registry key named HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\AD7Metrics\Engine\{00000000-0000-0000-0000-000000000000} and place a DWORD value under it named RequireFullTrustForSourceServer. Make sure this value’s value is 0. If you debug partially trusted code, I probably wouldn’t leave this off permantly though, or at least be very careful when debugger prompts you before running a source server command. The reason full trust is required is the debugger will execute commands from the binary’s pdb and if that pdb is from a partial trust assembly, those commands might be something bad. Thanks for reporting this.

Once I applied the steps outlined above, I started seeing the security warning dialogs, and voila! I had my code opening.


Written by Andy Hopper

January 6, 2012 at 9:30 am

Posted in .NET, Debugging

One Response

Subscribe to comments with RSS.

  1. […] a smiling bald guy, Andy Hopper, figured out how to make it all work. Turns out when opening a minidump, the “managed debugging engine tries to verify that each […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: