DebugDiag 不会公开开箱即用的 CLI。
但是,它公开了一个名为DebugDiag.DotNet.NetAnalyzer
via的类,该类DebugDiag.DotNet.dll
在 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 来自动化它。这里有两个项目,目前是这样使用的: