resolve-project-references
它能做什么
这项技能说明,.NET 构建报告中的 ResolveProjectReferences 步骤通常显示的是等待时间,而不是实际工作,并指出真正的减速原因。适合在缓慢的构建报告顶部看到该步骤的开发者。
适用场景
- ✓当 ResolveProjectReferences 在构建性能摘要中显示为最耗时的步骤时。
- ✓当开发者想直接加速 ResolveProjectReferences 时。
- ✓当某个步骤似乎占用了大部分构建时间,而你需要确认这是否属实的时候。
技能链接
https://github.com/dotnet/skills/blob/main/plugins/dotnet-msbuild/skills/resolve-project-references/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我的构建报告显示 ResolveProjectReferences 占用了大部分时间。我应该优化那一步吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会解释,报告的时间包括等待其他项目构建的时间,然后把你指向真正执行工作的步骤。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Misleading ResolveProjectReferences Time
Prevent misguided optimization of ResolveProjectReferences by explaining that its reported time is wall-clock wait time, not CPU work.
When to Use
ResolveProjectReferencesappears as the most expensive target in the Target Performance Summary- A developer is trying to optimize
ResolveProjectReferencesdirectly - Build performance analysis shows a single target consuming 50-80% of total build time
When Not to Use
- General build performance optimization (use
build-perf-diagnosticsinstead) - The bottleneck is clearly a different target (e.g.,
Csc,ResolveAssemblyReference) - The user has not yet captured a binlog or performance summary
Inputs
| Input | Required | Description |
|---|---|---|
| Build log or binlog | Yes | A diagnostic build log or binlog containing the Target Performance Summary |
Workflow
Step 1: Confirm the misleading symptom
Verify that ResolveProjectReferences appears as the top target in the Target Performance Summary. This is the misleading metric.
Step 2: Explain why it is misleading
The reported time includes waiting for dependent projects to build while the MSBuild node is yielded (see dotnet/msbuild#3135). During this wait, the node may be doing useful work on other projects. The target itself does very little work.
Step 3: Redirect to task self-time
Use the Task Performance Summary to identify the real bottleneck.
Primary: binlog MCP (preferred)
Use the binlog MCP server expensive_tasks tool to get task self-time rankings directly from the binlog.
Fallback: text-log replay (when MCP is unavailable)
dotnet msbuild build.binlog -noconlog -fl "-flp:v=diag;logfile=full.log;performancesummary"
grep "Task Performance Summary" -A 50 full.log
Focus on self-time of actual tasks:
- Csc: see
build-perf-diagnosticsskill (Section 2: Roslyn Analyzers) - ResolveAssemblyReference: see
build-perf-diagnosticsskill (Section 1: RAR) - Copy: see
build-perf-diagnosticsskill (Section 4: File I/O) - Serialization bottlenecks: see
build-parallelismskill
Validation
- Task Performance Summary was used instead of Target Performance Summary
-
ResolveProjectReferenceswas not set as the optimization target - A concrete task (e.g.,
Csc,Copy,ResolveAssemblyReference) was identified as the true bottleneck
常见问题
这一步总是不重要的吗?
这项技能说明它报告的时间具有误导性,因为该步骤本身在等待期间几乎不做什么工作。
我应该看什么?
这项技能指向任务自身耗时,它显示每个步骤自己真正做的工作。
这是一份通用的构建速度指南吗?
不是。关于通用构建性能,单独的诊断技能更合适。
详情
作者的原始描述
Guide for interpreting ResolveProjectReferences time in MSBuild performance summaries. Activate when ResolveProjectReferences appears as the most expensive target and developers are trying to optimize it directly. Explains that the reported time includes wait time for dependent project builds and is misleading. Guides users to focus on task self-time instead. Do not activate for general build performance -- use build-perf-diagnostics instead.
repo: dotnet/skills
热度
- GitHub 星标
- 5.8k
- 排名
- #14607
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
create-custom-agent
5.8k帮你的智能体创建 VS Code 自定义智能体文件,为每个智能体设置专属工具、指令以及向其他智能体的交接。
create-skill
5.8k帮你的智能体创建新的智能体技能,包括有效的名称、清晰的触发描述,以及符合标准的 SKILL.md 文件。
csharp-scripts
5.8k帮你的智能体通过 .NET 命令行工具以单个文件运行小型 C# 程序,无需创建完整项目。
dotnet-pinvoke
5.8k帮你的智能体在 .NET 中正确调用原生 C 或 C++ 库,涵盖函数签名、字符串处理、内存和安全句柄。