Profiling Web Projects in VS2008

I had a number of problems using VS2008’s profiler today so I thought I’d share my finding to lesson the suffering for others!

I’m working on a solution with a large number of projects all starting from a web project. All of the projects are strongly named. I wanted to use ‘instrumentation’ in order to get the most accurate statistics I could gather.

Problem 1.
When I first tried to launch the profiler it complained that my project was signed. The problem is that instrumentation requires the profiler to inject code into my DLL therefore changing the DLL, thus breaking the signature of the code. Happily it tells you that you can use an instrumentation step to re-sign the DLL.

Problem 2.
Ok, now luckily I’d been here before (and blogged how) so I added the re-sign code and tried again. So it launched (using IIS rather than Cassini) and I navigated around the site and finished the session. However the report was gibberish and contained hex numbers and guids where function and DLL names should be, not good. So it looks like a problem with the pdbs. After setting a number of pdb locations and ensuring the pdbs were serialized correctly I finally decided that the injection of code was upsetting the pdb so I switched off signing for every project.

Problem 3.
Still gibberish. Odd. I went to the ASP net temporary files and delete the lot. Re ran it and hurray something that looks like a profile.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Connecting to %s