此post包含有关如何将profiler作为以下批处理文件运行的信息
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#代码的结果,它没有配置文件信息,只有架构
可能出现什么问题?