Why can’t I connect a profiler?

I wrote a small profiler for .NET applications. It uses an interface ICorProfilerCallback2.

The profiler joins and works well for a .NET 2.0 application, but does not work for .NET> 2.0 (3.0, 3.5, 4.0). When I run exe compiled with .NET 4.0, nothing happens, but for .NET 2.0, the profiler starts. I set the following variables before running a managed exe

@Echo off
set Cor_Enable_Profiling=0x1
set COR_PROFILER={67D8965A-8686-2639-9C24-E1F7D13EE105}
set COR_PROFILER_DLL=e:\Debug\Profiler.dll
set COR_PROFILER_PATH=e:\Debug\Profiler.dll

Any idea why this might happen? He doesn't even fall intoDllMain

+3
source share
1 answer

Timotei,

, , :
API CLR: V2 CLR V4

CLR V4 ( ), , .

COMPLUS_ProfAPI_ProfilerCompatibilitySetting , ICorProfilerCallback3 V4.

CLR V4 , V2 V4 . ", CLR " ( , - ).

+4

Source: https://habr.com/ru/post/1760900/


All Articles