最近写的程序,界面用的WPF,底层用的C++。
在用VS 2008 的profiler测试性能的时候,只能看到C++的消耗,看不到.net 那边的。
The profiling environment for ***** is not set up correctly. Use vsperfclrenv.cmd to setup environment variables
换了 VS 2010也不行
查了资料:
http://blogs.msdn.com/b/davbr/archive/2009/11/04/clr-v4-profiler-attach-basics-with-sample-code.aspx
大概意思,要Profiler Managed Application:
1、程序先运行,然后attach,需要 CLR V4-based runtimes,否则是分析不了性能的
2、可以通过Launch Performance Wizard 来启动要分析的程序。这样.Net和C++部分的代码运行情况都可以分析到
好吧,我要分析的程序不是CLR V4-based runtimes,暂时只能用第二种方法了