Skip to content

dotnet

94 posts with the tag “dotnet”

Many coding agents, one board — why I built a developer agent board

One coding agent in a terminal is a joy. Three of them in parallel means three terminals, one shared checkout, questions buried in scrollback and pull requests nobody really checked. A tour of the developer agent board I built against that, with one branch and one git worktree per task, a fixed workflow with quality gates, and a human who only gets pulled in when it matters.

Architecture tests beyond code — project layering and XAML rules with Solution.Parser

A comment in a csproj can't stop a reference that quietly drags Roslyn into a package that never needed it, and no compiler notices a typo in a WPF binding path. Two worked examples from Solution.Parser's own repository: layering rules over projects and packages, and XAML rules checked against the C# behind them.

Code rules for everyone, architecture rules included — and when a Roslyn analyzer is the better home

Solution.Parser started as a way to make Roslyn-analyzer-style rules something every developer can write. Along the way it became just as useful for architecture validation: layering, project references, packages and XAML. How the pieces fit, and when a rule should graduate to a real analyzer.

Guard clauses in one line — getting started with Argument.Check

Fifteen lines of if/throw in front of three lines of real work, exception messages that name the wrong parameter after a rename, and a debugger that stops in the guard instead of in your code. How Argument.Check turns every guard clause into one readable line that returns the checked value, and what it does for you behind that line.

Test failures that explain themselves — diffs, curl and contract checks in AspNetCore.Simple.MsTest.Sdk

A bare "Expected:. Actual:<>." is where debugging starts, not where it ends. How AspNetCore.Simple.MsTest.Sdk turns a failing API test into a categorized report with the exact JSON path, the HTTP context, a ready-to-run curl and a suggested fix, and why it checks your test against the endpoint's own contract.

The Throw catalogue — every check in Argument.Check, with real messages

Null checks are the easy part. The interesting guards are the ones for strings, collections, ranges, files and types, plus your own rules in one line. A tour of every Throw helper in Argument.Check, grouped by what you check, with the exact exception each one throws and the handful of details you should know before you rely on them.

What a guard clause costs — benchmarking Argument.Check against hand-written checks

A helper method for every check, isn't that slower than an if? I measured it with BenchmarkDotNet on .NET 10, comparing hand-written guards, the built-in ThrowIfNull family and Argument.Check. Most checks cost the same as an if. Two didn't, the reasons are worth knowing for any library you write, and version 5.0.8 fixed both without breaking anything.

Your solution as a queryable model — code rules as LINQ with Solution.Parser

The team guideline says "no DateTime.Now", and code review finds it again every other week. Solution.Parser turns the whole solution into a typed model you query with LINQ, so a rule like that becomes a five-line unit test with clickable findings. How to get started, how to structure a rule suite, and how to prove a rule actually catches something.

NuGet audit — vulnerable packages you never referenced, and why publish finds what build doesn't

dotnet build is green, dotnet publish fails with NU1903 for a package nobody in the team has ever heard of. How NuGet audit works, why the restore graph of publish differs from build, how to find out who pulls in a transitive dependency, and how to fix or suppress findings without switching the whole check off.