solution-management

A set of rules for keeping .NET solutions consistent across projects. .NET is Microsoft's software platform; these rules cover its SDK version, shared build settings, package sources, and dependency versions.

In plain words
What is it for?
Use it to configure global.json, shared Directory.Build.props settings, centralized package management, secure package sources, and controlled SDK updates in development and CI.
Why use it?
It prevents different developers or build machines from using conflicting SDKs, settings, or package versions. That makes builds more repeatable and package management easier to maintain.

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/solution-management
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 1,277 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.01277
Opus 5 $0.00000 $0.00639
Sonnet 5 $0.00000 $0.00255
Haiku 4.5 $0.00000 $0.00128

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

Security

Grade A, and why

solution-management 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.

dotnet-sdk/solution-management.mdc · 174 lines

How it starts

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

Cursor Rules File: Best Practices for .NET Solution Management

Role Definition:

  • .NET Solution Architect
  • Build System Expert
  • Package Management Specialist

General: Description: > .NET solutions must be configured with explicit SDK versioning, shared build properties, and centralized package management to ensure consistency, maintainability, and security across all projects within the solution. Requirements: - Maintain a global.json for SDK version control - Use Directory.Build.props for shared metadata - Implement centralized package management - Configure secure and reliable package sources

SDK Version Management:

  • Maintain a global.json file in the solution root:
    • Specify exact SDK version to ensure consistent builds
    • Include rollForward policy for patch version flexibility
    • Example:
      {
        "sdk": {
          "version": "8.0.100",
          "rollForward": "patch"
        }
      }
      
  • Update SDK versions through controlled processes:
    • Test new SDK versions in development/CI before updating
    • Document SDK version changes in source control
    • Consider implications for CI/CD pipelines

Shared Build Properties:

  • Implement Directory.Build.props in solution root:
    • Define common metadata:
      • Company/Author information
      • Copyright details
      • Project URL
      • License information
      • Version prefix/suffix strategy
    • Example structure:
      <Project>
        <PropertyGroup>
          <Authors>Your Company</Authors>
          <Company>Your Company</Company>
          <Copyright>© $([System.DateTime]::Now.Year) Your Company</Copyright>
          <PackageLicenseExpression>MIT</PackageLicenseExpression>
          <PackageProjectUrl>https://github.com/your/project</PackageProjectUrl>
          <VersionPrefix>1.0.0</VersionPrefix>
        </PropertyGroup>
      </Project>
      
  • Consider environment-specific overrides:
    • Use Directory.Build.targets for overrides
    • Support CI/CD pipeline customization

Package Management:

  • Enable centralized package management:
    • Create Directory.Packages.props:
      • Define package versions once
      • Enforce consistent versions across projects
      • Example:
        <Project>
          <PropertyGroup>
            <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
          </PropertyGroup>
          <ItemGroup>
            <PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
          </ItemGroup>
        </Project>
        
  • Configure nuget.config:
    • Enable package source mapping
    • Define trusted package sources
    • Example:
      <?xml version="1.0" encoding="utf-8"?>
      <configuration>
        <packageSourceMapping>
          <packageSource key="nuget.org">
            <package pattern="*" />
          </packageSource>
        </packageSourceMapping>
        <packageSources>
          <clear />
          <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
        </packageSources>
      </configuration>
      

Maintenance:

  • Regular auditing:
    • Review SDK versions for security updates
    • Validate package versions for vulnerabilities
    • Update shared metadata as needed
  • Version control:
    • Commit all configuration files
    • Document changes in commit messages
    • Consider using git hooks for validation

Compilation:

  • Use dotnet CLI for builds:
    • Prefer dotnet build over IDE builds for consistency
    • Use dotnet build -c Release for release builds
    • Enable deterministic builds with /p:ContinuousIntegrationBuild=true
  • Enforce code quality:
    • Enable TreatWarningsAsErrors in Directory.Build.props:
      <PropertyGroup>
        <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
        <!-- Optionally allow specific warnings -->
        <WarningsNotAsErrors>CS1591</WarningsNotAsErrors>
      </PropertyGroup>
      
    • Address warnings properly:
      • Fix the underlying issue rather than suppressing
      • Document any necessary warning suppressions
      • Use #pragma warning disable sparingly and only with comments
  • Build configuration:
    • Use conditional compilation symbols purposefully
    • Define debug/release-specific behavior clearly
    • Example:
      <PropertyGroup>
        <DefineConstants>TRACE</DefineConstants>
        <DefineConstants Condition="'$(Configuration)'=='Debug'">$(DefineConstants);DEBUG</DefineConstants>
      </PropertyGroup>
      
  • Performance:
    • Enable incremental builds by default
    • Use dotnet build --no-incremental only when needed
    • Consider using Fast Up-to-Date Check:
      <PropertyGroup>
        <DisableFastUpToDateCheck>false</DisableFastUpToDateCheck>
      </PropertyGroup>
      
  • Build output:
    • Set consistent output paths
    • Configure deterministic output:
      <PropertyGroup>
        <Deterministic>true</Deterministic>
        <ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
      </PropertyGroup>
      
  • Error handling:
    • Log build errors comprehensively
    • Use MSBuild binary log for detailed diagnostics:
      dotnet build -bl:build.binlog
      
    • Configure error reporting in CI/CD:
      - name: Build
        run: dotnet build --configuration Release /p:ContinuousIntegrationBuild=true
        env:
          DOTNET_CLI_TELEMETRY_OPTOUT: 1
          DOTNET_NOLOGO: 1
      

Read the full file on GitHub · 174 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 · 174 lines · 1,277 tokens per session scan A d2141490cbed

Subscribe to this mod's changes

solution-management 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 1,277 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.