Welcome to MSDN Blogs Sign in | Join | Help

How to profile signed assemblies in instrumentation mode

If you have tried to profile signed binaries in instrumentation mode you may have seen the following error message pop up.

 

 

If you attempt to continue, then the application that you are profiling will probably crash and you will not collect any data. The issue at hand is that when we instrument a binary we end up removing its signing data. Luckily there is a fairly quick and easy way around this issue.

 

I have created a simple console application that consumes a class Microsoft.Ian.Muggle that is defined in a signed class library ClassLibrary1.dll. For signing I just used the standard Visual Studio signing mechanism on the properties page for ClassLibrary1. I have created a performance session where I have chosen ConsoleApplication2 as the launch application and I have chosen to instrument only ClassLibrary1.

 

When I attempt to profile the above scenario, I get the error message picture at the top of this post, and I do not collect any profiling data. So now I want to setup signing in my post instrumentation step. To access the post instrumentation step, just right click and binary that you are instrumenting and click properties (see below).

 

Then in the properties menu select the instrumentation tab from the left hand menu. On the instrumentation page there will be a group box for both pre and post instrumentation steps. Since we want to re-sign after instrumentation, we will have to fill out the post instrument step.

 

I used the following command line, but you will have to fix up this command line with the correct paths to your sn.exe, binary name and keyfile location.

C:\WINDOWS\Microsoft.NET\Framework\v2.0.x86ret\sdk\bin\sn.exe -R C:\Test\ConsoleApplication2\ClassLibrary1\obj\Debug\ClassLibrary1.dll C:\Test\ConsoleApplication2\ClassLibrary1\IanKey.snk

 

 

If you want, you can add a description in the box below the command line box. This description will show up in the output window during the instrumentation process.

 

Now that we have resigned the binary, just run the performance session as usual. Now we will have no error message and we get the data from ClassLibrary1.dll.

 

Published Monday, July 25, 2005 9:18 AM by ianhu
Filed under:

Comments

# New team blog posts

There are a couple of new posts from some of the profiler team members:
 
Steve Carroll answers...
Monday, July 25, 2005 1:21 PM by Enterprise Performance Tools Team

# Profiling Signed Assemblies

Ian Huff has an entry today about the problems you'll run into when using Visual Studio Team System to...
Tuesday, July 26, 2005 5:38 PM by .Net Security Blog

# Suggested Reading - 2005-07-31

Cleaning-out my “To Blog” file again…
Architects

Handling data in service oriented systemsEdward...
Monday, August 01, 2005 2:58 AM by Rob Caron's Blog - A Team System Nexus

# VSTS Links - 8/1/2005

Eric Jarvi - VSTS Tip: Branching Source Code

Eric discusses what to do and not do when branching source...
Monday, August 01, 2005 10:33 AM by Team System News

# The Profiling Team’s Greatest Hits: Volume Two

The profiler team has been crazy busy with getting Visual Studio Team System shipped and out the door,...
Monday, March 06, 2006 3:46 PM by IanWho's bLog
New Comments to this post are disabled
 
Page view tracker