Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using WPFPerf to profile a WPF 4.0 application doesn't show me any information

Tags:

profiling

wpf

I am trying to use WPFPerf to profile a WPF 4.0 application (I have the latest WPFPerf that should work on WPF 4.0 aps). I start the tool Visual Profiler from WPFPerf, I start my aplication, but after that nothing happens and the element tree from the Visual Profiler is empty. No other error message is shown. Can anyone tell me what am I not doint right?

As an additional information, when I try to analize my .exe assembly or any other assembly from my application, I get a BadFormatException saying that the assembly was build with a newer version of .NET. From the download page http://go.microsoft.com/fwlink/?LinkID=191420 I see that this version of WPFPerf should be ok for my app

like image 251
Adrian Avatar asked May 31 '10 06:05

Adrian


2 Answers

TimeZone patch to WPF Performance Profiling Tools for WPF 4 is now available http://blogs.msdn.com/b/jgoldb/archive/2010/08/24/timezone-patch-to-wpf-performance-profiling-tools-for-wpf-4-is-now-available.aspx

like image 152
Nick Avatar answered Oct 28 '22 13:10

Nick


First check to see if its working even with a small blank WPF application. If it is not working with a blank WPF app, then it likely is the patch already mentioned: TimeZone patch to WPF Performance Profiling Tools for WPF 4 is now available

However, in my case that wasn't the issue. Visual Profiler has a bug that causes it not to display the Element tree if it doesn't like some of the characters in its main window title bar.

Through hours of trial and error, I was able to trace the root cause of why it would not work on our application even though it would on a blank WPF application. The reason is that our application has a special character in the title bar text (trademark). If we eliminate the special character from the main window title, the element tree shows fine when the visual profiler is attached. I was able to reproduce this issue in the simple blank WPF application too simply by putting the following property on the main window:

<Window ..... Title="Test Application™" > 

Looks like a bug in Visual Profiler that somehow is triggered by special characters. I didn't test for other special characters, but likely it isn't just this one.

So the workaround is to remove the special character while you are profiling until they fix this.

like image 30
gdog Avatar answered Oct 28 '22 12:10

gdog