9

The CLR profiler I downloaded from here link text does not work for my app which is implemented using .NET 4.0. Is there a version for .NET 4.0? Thanks.

jiangok
  • 2,622
  • 3
  • 21
  • 26
  • While you're hunting for a profiler, [you might try this.](http://stackoverflow.com/questions/2473666/tips-for-optimizing-c-net-programs/2474118#2474118) – Mike Dunlavey Dec 06 '10 at 02:18

2 Answers2

11

UPDATE: The CLR Profiler for .NET Framework 4 is now available here.

I couldn't find the CLR Profiler for .NET 4.0, but you should be able to use the older version if you set the environment variable: COMPLUS_ProfAPI_ProfilerCompatibilitySetting. For more information see this blog post.

Also note that as of .NET 4.0 the CLR outputs some more information to the Event Log to help you diagnose issues loading profilers. You can easily view these logs with the Event Viewer.

valiano
  • 16,433
  • 7
  • 64
  • 79
Colin Thomsen
  • 1,806
  • 15
  • 11
  • I'll also throw in a plug for the profiler in Visual Studio 2010 (Ultimate or Premium), which fully supports .NET 4.0. (Disclaimer: I work on the VS profiler) – Colin Thomsen Dec 04 '10 at 05:18
  • When I start a .NET 4.0 application using CLR profiler 2.0, it stucks at "wait for application to start common language runtime". When I click show – jiangok Dec 04 '10 at 07:50
  • I also tried both DisableV2Profiler and EnableV2Profiler for COMPLUS_ProfAPI_ProfilerCompatibilitySetting and neither made 2.0 CLR profiler work for .net 4.0 app. Could you please tell me what I am missing? Thanks. – jiangok Dec 04 '10 at 08:01
  • I think you need to use a different link to download CLRProfiler. Please try this one: http://www.microsoft.com/downloads/en/confirmation.aspx?FamilyID=a362781c-3870-43be-8926-862b40aa0cd0 – Colin Thomsen Dec 04 '10 at 16:52
  • Thanks this one works with COMPLUS_ProfAPI_ProfilerCompatibilitySetting = EnableV2Profiler – jiangok Dec 05 '10 at 02:24
  • You mentioned there are .NET logs in event viewer. Would you mind provide the path to the node? I cannot find .NET or CLR in event log on windows server 2008 R2. Thanks. – jiangok Dec 05 '10 at 02:28
  • For .NET 4, you should see messages in: 'Windows Logs, Application'. The messages have the source '.NET Runtime' and will have content like this: .NET Runtime version 4.0.30319.206 - The profiler was loaded successfully. Profiler CLSID: '{F1216318-0905-4fe8-B2E8-105CEB7CD689}'. Process ID (decimal): 1716. Message ID: [0x2507]. – Colin Thomsen Feb 02 '11 at 17:39
  • what are the differences between clr profiler for .net 4 and visual studio 2010 profiler? – giammin Feb 19 '12 at 15:32
4

CLR Profile 4.0 can be downloaded here:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=f4addc9d-be61-4ebc-90b2-5f50812c2037

it looks like the installer is 64bit only, but you can unpack it using 7z and the 32bit version is inside the package.

WalkingCat
  • 263
  • 3
  • 10
  • 1
    Has this download been pulled? – Ant Jan 29 '11 at 00:13
  • 1
    Seems to have been re-released at: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=be2d842b-fdce-4600-8d32-a3cf74fda5e1 – Ant Feb 03 '11 at 00:30