一键导入
dotnet-build
.NET build configuration and error handling. Use when building projects, diagnosing build errors, or configuring build options.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
.NET build configuration and error handling. Use when building projects, diagnosing build errors, or configuring build options.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Interactively elicit, capture, and maintain software/system requirements as a living, traceable repository. Use whenever the user wants to gather, write, refine, or organize requirements — including producing or updating an SRS (software/system requirements specification), writing ADRs / architecture decision records, building a requirements traceability graph (DAG), or keeping a decision ledger. Trigger proactively when the working folder already holds requirements artifacts (a `requirements/` folder of YAML, `decisions/` ADRs, an `srs.md`, or `ledger.md`), or when the user shares documents that are clearly specs, RFCs, or feature briefs and wants them structured. Also use for phrases like "let's spec this out", "interview me about what we're building", "capture these requirements", "write a decision record", or "turn these notes into a spec". Not for project management, code review, application code, dependency manifests like requirements.txt, or hardware "system requirements" (RAM/CPU).
Use this skill whenever the user wants to create a bash script that drives an autonomous coding loop — scripts that run Claude Code on a schedule (cron, GitHub Actions, systemd timer) or on-demand to make repository improvements, execute plans, triage issues, or otherwise do agentic work with minimal human intervention. Triggers include phrases like "scout script", "autonomous script", "agent harness", "script that runs on a schedule", "script that implements a plan", ".scripts/*.sh", or any request for a bash script whose body is "run Claude Code with a prompt and commit the results". Always use this skill before writing such a script — it encodes the interview flow, the adversarial-reviewer pattern, and the locking/ledger conventions.
Task structure and atomic commit patterns for granular, verifiable work units
Conflict identification and resolution patterns for requirements, decisions, and plans
Context window management techniques for maintaining efficiency and preventing context bloat
Exploration map management for tracking discussed areas and uncharted territory during DISCUSS phase
| name | dotnet-build |
| description | .NET build configuration and error handling. Use when building projects, diagnosing build errors, or configuring build options. |
| allowed-tools | Read, Grep, Glob, Bash |
# Build solution/project
dotnet build
# Build specific project
dotnet build src/MyApp/MyApp.csproj
# Build with configuration
dotnet build --configuration Release
dotnet build -c Debug
# Clean build (no incremental)
dotnet build --no-incremental
# Build without restoring packages
dotnet build --no-restore
# Specify output directory
dotnet build --output ./artifacts
# Build for specific runtime
dotnet build --runtime win-x64
dotnet build --runtime linux-x64
# Build framework-specific
dotnet build --framework net8.0
<!-- Default configurations in .csproj -->
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>false</Optimize>
<DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
</PropertyGroup>
<!-- Treat all warnings as errors -->
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<!-- Treat specific warnings as errors -->
<PropertyGroup>
<WarningsAsErrors>CS0168;CS0219</WarningsAsErrors>
</PropertyGroup>
<!-- Suppress specific warnings -->
<PropertyGroup>
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>
# Build entire solution
dotnet build MySolution.sln
# Build specific projects from solution
dotnet build MySolution.sln --project src/Api
# Parallel build (default)
dotnet build --maxcpucount
# Sequential build
dotnet build --maxcpucount:1
<!-- ProjectReference in .csproj -->
<ItemGroup>
<ProjectReference Include="..\Domain\Domain.csproj" />
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
</ItemGroup>
| Code | Description | Common Fix |
|---|---|---|
| CS0103 | Name does not exist | Check spelling, add using statement |
| CS0246 | Type/namespace not found | Add package reference, add using |
| CS1061 | Member does not exist | Check type, update interface |
| CS0029 | Cannot convert type | Add cast, fix type mismatch |
| CS0120 | Object reference required | Make static or instantiate |
| Code | Description | Common Fix |
|---|---|---|
| MSB3202 | Project file not found | Fix path in ProjectReference |
| MSB4019 | Target file not found | Restore packages |
| MSB3644 | Framework not installed | Install SDK |
| MSB3245 | Reference not resolved | Restore packages, check path |
| Code | Description | Common Fix |
|---|---|---|
| NU1101 | Package not found | Check package name/source |
| NU1103 | Version not found | Check available versions |
| NU1202 | Incompatible framework | Update package or framework |
| NU1605 | Downgrade detected | Resolve version conflicts |
# Restore packages
dotnet restore
# Restore with specific source
dotnet restore --source https://api.nuget.org/v3/index.json
# Clear NuGet cache
dotnet nuget locals all --clear
# List packages
dotnet list package
dotnet list package --outdated
# Detailed build output
dotnet build --verbosity detailed
dotnet build -v d
# Diagnostic output (most verbose)
dotnet build --verbosity diagnostic
# Minimal output
dotnet build --verbosity quiet
# Generate binary log for analysis
dotnet build -bl
# View with MSBuild Structured Log Viewer
# Download from: https://msbuildlog.com/
# Clean build artifacts
dotnet clean
# Clean specific configuration
dotnet clean --configuration Release
# Force clean (delete bin/obj manually)
rm -rf **/bin **/obj
<!-- Ensure consistent framework across projects -->
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
# Check installed SDKs
dotnet --list-sdks
# Install specific version via global.json
{
"sdk": {
"version": "8.0.100"
}
}
# Kill processes holding files (Windows)
taskkill /F /IM dotnet.exe
# Kill processes (Linux/Mac)
pkill dotnet
See common-errors.md for detailed error resolutions.