question

linqx-1366 avatar image
0 Votes"
linqx-1366 asked XingyuZhao-MSFT commented

Set COR_PROFILER_PATH env variable but no start my profiler

![96711-image.png][2]


96660-image.png


[2]: /answers/storage/attachments/96560-image.png


I setup a profiling environment by set environment variables: COR_ENABLE_PROFILING, COR_PROFILER, COR_PROFILER_PATH on .net 4.0+ without my profiler being registered.

I found my profiler dll is not loaded by clr, why?

dotnet-runtime
image.png (108.1 KiB)
image.png (83.5 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @linqx-1366 ,
Take a look at the following references:

  1. Setting Up a Profiling Environment

  2. .NET Profiling API initialization

Hope them could be helpful.

0 Votes 0 ·

Hi, thanks for your anwser. COR_PROFILER_PATH env is set, but according to eventlog, it got the message(0x80040154 may means COR_E_BADEXEFORMAT):

.NET Runtime version 4.0.30319.0 - 在 CoCreateInstance 期间加载探查器失败。探查器 CLSID:“{22B677AD-2950-4169-B330-633D8DBBDE9F}”。HRESULT: 0x80040154。 进程 ID (十进制): 2648。消息 ID: [0x2504]。


0 Votes 0 ·

sorry, 0x80040154 is REGDB_E_CLASSNOTREG, I think is that setting env COMPLUS_ProfAPI_ProfilerCompatibilitySetting to EnableV2Profiler makes REGDB_E_CLASSNOTREG. When I remove env COMPLUS_ProfAPI_ProfilerCompatibilitySetting, it got another HRESULT 0x800700c1, which means COR_E_BADEXEFORMAT

0 Votes 0 ·
Show more comments

0 Answers