dotnet-build

A set of rules for building .NET projects with the native dotnet command-line tools. It separates building, testing, and releasing so each part of the workflow has a clear purpose.

In plain words
What is it for?
Use it to organize build files, pin the .NET SDK, manage package versions, create cross-platform build scripts, and document prerequisites.
Why use it?
It avoids duplicated build logic, environment-specific paths, and overly complicated build systems. It also makes the process easier to run across operating systems.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/aaronontheweb/dotnet-cursor-rules/dotnet-build
Clone the repo
git clone --depth 1 https://github.com/Aaronontheweb/dotnet-cursor-rules
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 5,571 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.05571
Opus 5 $0.00000 $0.02786
Sonnet 5 $0.00000 $0.01114
Haiku 4.5 $0.00000 $0.00557

Measured 2d ago against content hash 73019e4d7f67, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dotnet-build scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

ci-cd/dotnet-build.mdc · 867 lines

How it starts

The opening of the file, as written. The whole thing — 867 lines — stays where its author put it; the contents beside it link to each section on GitHub.

.NET Build System Rules and Best Practices

Core Build Philosophy

✅ DO

  • Use native dotnet CLI commands as the primary build mechanism
  • Keep build scripts simple, maintainable, and cross-platform compatible
  • Use PowerShell for custom build tasks that can't be handled by dotnet CLI
  • Maintain clear separation between build, test, and release processes
  • Document all build prerequisites and requirements

❌ DON'T

  • Use complex build systems like CAKE, FAKE, or NUKE
  • Mix build and deployment logic in the same scripts
  • Hardcode environment-specific paths or settings
  • Implement complex logic in YAML pipelines (use PowerShell scripts instead)
  • Duplicate build logic across different files

Project Structure

[!IMPORTANT] Don't create new files without first checking existing ones. Build system files should follow a consistent, predictable structure.

Required Files and Their Purposes

├── Directory.Build.props       # Central version and package metadata
├── Directory.Packages.props    # Centralized package version management
├── global.json                # SDK version pinning
├── RELEASE_NOTES.md           # Version history and release notes
├── build.ps1                  # Version management script (minimal)
├── scripts/                   # PowerShell helper scripts
│   ├── getReleaseNotes.ps1    # Parse release notes
│   ├── bumpVersion.ps1        # Update assembly versions
│   ├── integration-tests.ps1  # Integration test runner
│   └── *.ps1                 # Other build helper scripts
├── build-system/             # CI/CD pipeline definitions
│   ├── azure-pipeline.template.yaml  # Shared pipeline template
│   ├── windows-pr-validation.yaml    # Windows PR validation
│   ├── linux-pr-validation.yaml      # Linux PR validation
│   └── windows-release.yaml          # Release pipeline
└── .github/workflows/        # GitHub Actions (if used)
    ├── pr-validation.yaml    # PR validation
    └── release.yaml          # Release workflow

Read the full file on GitHub · 867 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 867 lines · 5,571 tokens per session scan A 73019e4d7f67

Subscribe to this mod's changes

dotnet-build is a cursor rule published in the GitHub repository Aaronontheweb/dotnet-cursor-rules (134 stars, last pushed 1y ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 5,571 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.