Question

I've been looking to get some profiling reports on a project I'm working on. I've looked at many of the options out there and I've personally used dotTrace and ANTS before but decided to give the Visual Studio built in Profiling a shot.

So far it seems pretty good all in all. Had to jump through some hoops to get it working in the first instance but its running OK now.

The problem I have is that my project is a Composite WPF application using PRISM which means there are no static references between the EXE file and the majority of the logic which resides in the Module class library projects.

This isn't the first time I've seen some usually very good tools get confused by composite applications so I'm not going to hold that against the profiler. However it does mean that 90% of what I want to profile in the application is actually excluded from the reports and remains completely un-profiled. Not helpful.

I have all the libraries I'm interested in profiling added to the Instrumentation session so it's all ready to go the problem is it doesn't seem to follow the execution paths into my Modules internals.

Has anyone managed to get a PRISM app using a DirectoryLookupModuleEnumerator (no static refs) approach successfully and fully profiled?

Was it helpful?

Solution

HA! The cardboard developer strikes again!

One additional complication in my particular scenario is that my compiled application isn't in the usual bin\Debug locations. Each project copies itself and any dependencies into a completely separate location (kind of like deployment I guess) and then executed from there when I debug.

What I've done to get this working:

  1. The usual nasty post signing shenanigans to get the strong names to play nicely

  2. Instead of going through the wizard simply click Start Performance Analysis under the Analyze menu

  3. This will start the performance analysis and should honour any debug setup in your start up projects properties page.

  4. Go back to the Visual Studio 2012/2013 instance you started from.

  5. Right-click on the Targets node in the Performance Explorer panel.

  6. Select Add Target Binary and then in the file browser select the compiled modules that form the composited parts of your application

  7. Run your app as you wish and then select Stop Profiling when you're done.

  8. Explore to see just how crap your code is! :)

NB: last step is optional.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top