The problem you're running into is that you made an incorrect assumption at the outset that the Compact Framework supports any of the ICorProfilerCallBack
interfaces. It does not. If you want to do profiling, a few paths have been followed in the past by other profilers I've seen/used:
- Use reflection to rebuild and instrument the CF assemblies on the desktop. Using your own proprietary publishing paradigm, you can push out function enter/exit messages and things like that. This is useful for code profiling, but not so much for memory profiling.
- Build Mono.Cecil for the CF and use it to instrument/emit right on the target device. This is slower, but more portable.
- Use the completely undocumented memory profiling APIs in the CF like the CF CLR Profiler uses. I've hunted for any docs on these and come up empty, and I've tried pushing to get Microsoft to open source the tool on Codeplex, but I've made zero progress on either, so this would be a lot of reverse engineering of network packets with the existing tool and Wireshark.