views:

218

answers:

2

I have a Visual Studio 2008 unit test project that depends on a dll project in the same solution. With this setup, I want to profile a single unit test with a Visual Studio performance session. Said test calls into methods located in the dll project and I want to see where the perf bottleneck is in that dll.

So far so good. At first it seemed simple: In Visual Studio Test View, I right-clicked on the relevant test and chose "Create Performance Session...". In the wizard that follows, I chose instrumentation. However, after running the resulting performance session, only data for methods located in the unit test dll were shown. I then right-clicked on the "Targets" folder in the perf session and chose "Add Target Binary..." to add the dll (I chose the dll under bin/release in the dll project folder). This works inasmuch as that the dll is now instrumented too, but I keep missing the perf data for the methods in that dll. I tried to add the dll from different locations ...

  • bin/release under the dll project folder
  • obj/release under the dll project folder
  • bin/release under the unit test dll project folder

... none of which worked.

I'd appreciate feedback on how to gather perf data of the dependent dll.

+1  A: 

Hi Andreas,

I had exactly the same problem as you, but I could solve it adding the Targets the same as you did, but with one minor difference, however: I selected "Add target project" instead of "Add target binary". Then it worked correctly.

Maybe it's a problem with the binaries you select, or maybe a bug in VS2008. I recommend you, if it's possible, to add the binaries you're trying to profile as a project in the solution.

Hope this helps.

Juan Calero
Thanks for your answer. I ended up compiling a new exe that called into the dll. Works too but is of course more cumbersome than what you suggested. When I get around to do more profiling, I'll try your suggestion.
Andreas Huber
A: 

I have the same problem. The DLL I want to profile is a project within the solution but that project doesn't get listed in the list of projects available for targetting for profiling for some reason.

Craig Fisher