views:

4666

answers:

4

In all of my searching, I've only been able to find this one link that suggests the old CLR Profiler for .NET 2.0 should work with .NET 3.0 or 3.5 applications.

When I try and profile my .NET 3.5 SP1 WPF application with the CLR Profiler for .NET 2.0 it starts up my application just fine, but it throws up a dialog that says "Waiting for application to start common language runtime".

Since my application clearly uses the CLR, I can only conclude that the CLR Profiler for .NET 2.0 does not work with newer versions of the framework (maybe it's just a problem with 3.5 SP1 apps).

So, does anyone know if there is a version of the CLR profiler that works with 3.5 SP1? If there isn't a version of Microsoft's profiler, is there another free profiler that I could use that has similar functionality?

+2  A: 

The CLR used in 2.0 framework and 3.5 framework differs only by a service pack. The CLR has the version 2.0 and 2.0SP1 for the respective versions. The CLR profiler will work against the 2.0SP1 version of the CLR.

Small Correction: There is no 3.5 version of the CLR. The most recent versions are 2.0, 2.0SP1 and 2.0SP2 (associated with .Net Framework SP1).

JaredPar
So the CLR Profiler works against the 2.0SP1 version of the CLR - how about against 2.0SP2? I'm assuming that's what ships with 3.5SP1 - at least thats what I'm gathering from your answer... am I wrong?
unforgiven3
+8  A: 

I just tried running CLR Profiler with a WPF application, and it works fine. It takes a while for the application to start (longer than with non-WPF applications, it feels like), but it works.

Update: just to keep the answer up to date; according to the comments below, the solution was to run the CLR Profiler with administrative rights.

Fredrik Mörk
I left my application running for nearly 20 minutes, waiting for the "Waiting for application to start common language runtime" message to go away. My app was up and running, I was interacting with it fine - my app clearly had started the CLR. What framework version was your WPF app targeting?
unforgiven3
It's targeting .NET Framework 3.5. I did see a not somewhere that it needs to run with administrative rights (don't know if that was for WPF applications specifically). Did you try that?
Fredrik Mörk
Good call on running it with administrative rights - that was all I needed! Thanks!
unforgiven3
A: 

Don't make the stupid mistake I did and try to use CLR profiler v1.1 – the correct one is CLR Profiler for .NET Framework 2.0 (even if you use .NET 3.5).

svick
+1  A: 

I've just used the CLR profiler 2 with my .NET 4.0 WPF application. It could launch the App but when click on "Show Heap Now" or any items under "View" menu it showed report windows with empty figures. So I wonder if anyone already tried it successfully? Or it is just not supports for .NET WPF apps.

It's not that it doesn't support WPF, it's that it won't work for .NET 4.0. .NET 3.5 was a set of extra libraries on top of the .NET 2.0 runtime, i.e. the core runtime didn't change - that's why V2 of the profiler still worked. With .NET 4.0 we have a new runtime.
donovan