【发布时间】:2011-06-26 07:37:48
【问题描述】:
这个post 有关于如何运行分析器作为以下批处理文件的信息
vsperfcmd /start:coverage /output:run.coverage
hello
vsperfcmd /shutdown
进入 C# 代码
// A guid is used to keep track of the run
Guid myrunguid = Guid.NewGuid();
Monitor m = new Monitor();
m.StartRunCoverage(myrunguid, "run.coverage");
// TODO: Launch some tests or something
// that can exercise myassembly.exe
// Complete the run
m.FinishRunCoverage(myrunguid);
对于TODO: 部分,我使用了这段代码
p = new Process();
p.StartInfo.FileName = "hello.exe";
p.Start();
p.WaitForExit();
// Look at return code – 0 for success
if (p.ExitCode != 0) {
Console.Error.WriteLine("Error in profiling");
System.Environment.Exit( -3 );
}
代码运行良好,但我无法通过运行批处理文件得到分析结果。
这是运行包含所有信息的批处理文件的结果。
这是 C# 代码的结果,它没有配置信息,但只有架构
可能出了什么问题?
【问题讨论】:
-
您的最后一句“..I can't ? the profiled result...”中少了一个词。缺少的词是什么?这很重要:)
-
@Elroy :我详细阐述了这个问题,感谢您指出。
-
我不知道,真的,但您是否使用管理员权限运行?
标签: visual-studio-2010 profiling code-coverage profiler