Search code examples
c++.netprofilingprofiler

DLL not working on x64 system


I just wrote a .NET profiler (a DLL which will be used by CLR). Actually, the DLL works on Windows XP with applications that are designed for Any CPU and Win32 applications. However, on Windows 7 x64, it only works with applications designed for x86 architectures. Where could be the problem? Any help would be appreciated.

UPDATE : is it possible to build a DLL for Any CPU?? if not, any alternatives?


Solution

  • I've found the solution In David Broman Blog:

    For x86 Machine 
     - Just run regsvr32 like you usually do.
    For x64 or ia64 Machine    
     - If you want to be able to profile 64 bit apps, 
             run 64 bit regsvr32 against your 64 bit Profiler DLL
     - If you want to be able to profile 32 bit apps (WOW), 
             run 32 bit regsvr32 against your 32 bit Profiler DLL.
     - If you want to support both, do both!
    

    In other words, if we want to profile all applications on a x64 machine we need to build 2 DLLs with the same GUID (CLSID), one for x86 applications and the other for x64 ones.