4

I tried to use a Performance wizard tool for my short C++ testing in VS 2010 Ultimate.

But for any code the profiling process crashes and the following error occurs:

Could not launch xxx.exe. Injection of runtime library failed. 

By this time I used Netbeans and with the VS 2010 profiler I do not have much experience.

I wonder whether this function is available for unmanaged C++... The C++ code is correct...

Configuration: VS 2010 Ultimate, Win 7 Prof. 32 bit.

Updated question: An instrumentation method works well but the CPU sampling method still does not work.

Johnas
  • 103
  • 1
  • 4

3 Answers3

0

This problem can be caused by some security or anti-malware program installing hooks in your program, so the profiler cannot get its hooks in. Some vendors provide ways to limit those hooks so you can profile, or you could just try turning it off for a period while profiling.

Bryan
  • 11,398
  • 3
  • 53
  • 78
0

Yes, the profiler works on native code.

Try running Visual Studio as an elevated admin user.

Ben Voigt
  • 277,958
  • 43
  • 419
  • 720
  • I had probably the same problem, just wanted to try this profiling. I don't remember exactly error message. I was running VS under admin rights. – Andriy Tylychko Sep 16 '11 at 20:52
  • @johnas: Can you try running the profiler on a "Hello World"-style project, to make sure your VS install is ok? – Ben Voigt Sep 16 '11 at 21:24
  • 1
    @Ben I profiled a Hello world project with the same results: CPU sampling method does not work. I brough also my notebook with 64 bit version of VS 2010 and the behavior is same. I also uninstalled all extensions. – Johnas Sep 16 '11 at 21:34
0

Check if you have enabled Application Verifer shims for your application.

Rolf Kristensen
  • 17,785
  • 1
  • 51
  • 70