有没有办法从命令行运行DebugDiag Analysis?
问题描述:
有没有办法从命令行调用DebugDiag分析?我试过这个: DebugDiag.Analysis.exe "C:\dumps\oops.dmp"
但它只启动了GUI(添加了oops.dmp
)。有没有办法从命令行运行DebugDiag Analysis?
我所寻找的是更多的东西是这样的: DebugDiag.Analysis.exe -dump "C:\dumps\oops.dmp" -out "C:\results\oops-DebugDiag.mht" -anaylsis "CrashHangAnalysis,MemoryAnalysis"
那么这应该运行,而不显示任何GUI。
用例:我们正在使用SuperDump完全自动运行崩溃转储分析。自动添加DebugDiag .mht
报告将非常好。
可以这样做吗? DebugDiag命令行选项上是否有任何文档?
答
DebugDiag不会提供开箱即用的CLI。
但是,它通过DebugDiag.DotNet.dll
公开了名为DebugDiag.DotNet.NetAnalyzer
的类,它在DebugDiag的安装目录中可用。这里是它的文档:
/// <summary>
/// The NetAnalyzer object is used to determine available analysis scripts, add data files, and start an analysis.
/// This object is used internally by the DebugDiag Analysis user interface to manage analysis rules.
/// End users can use this object to develop their own rules, batch files, or GUI's to manage data analysis.
/// </summary>
/// <remarks>
/// <example>
/// <code language="cs">
/// using (NetAnalyzer analyzer = new NetAnalyzer())
/// {
/// //In this example I'm referencing a dll module that has the prebuild rules that ship with debugdiag
/// analyzer.AddAnalysisRulesToRunList(@"C:\Program Files\DebugDiag\AnalysisRules\DebugDiag.AnalysisRules.dll", false);
///
/// List<AnalysisRuleInfo> analysisRules = analyzer.AnalysisRuleInfos;
///
/// Console.WriteLine("The available rules on the analyzer are: \n\r\n\r");
///
/// foreach(AnalysisRuleInfo ruleInfo in analysisRules)
/// {
/// Console.WriteLine(ruleInfo.DisplayName);
/// }
/// }
/// </code>
/// </example>
/// </remarks>
所以,基本上可以使用这个API来自动化它。这里有两个项目,目前像这样使用: