dotnet-slnx
Skill2 starsChanged 42 days agoMITView on GitHub
Use when creating, converting, editing, or troubleshooting a .NET solution file — choosing .slnx vs .sln, running `dotnet new sln`/`dotnet sln add|remove|list|migrate`, hand-editing solution XML, wiring solution filters (.slnf), or fixing "multiple solution files" / legacy-tooling build errors. The detailed authority on solution file format and hygiene.
In this repository56 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- benchmarkingSkill
- commit-messagesSkill
- csharp-15-syntaxSkill
- csharp-aot-trimmingSkill
- csharp-api-designSkill
- csharp-assembly-inspectionSkill
- csharp-asyncSkill
- csharp-collections-modernSkill
- csharp-concurrency-primitivesSkill
- csharp-data-layoutSkill
- csharp-debuggingSkill
- csharp-discardsSkill
- csharp-disposable-patternsSkill
- csharp-docsSkill
- csharp-error-handlingSkill
- csharp-extension-membersSkill
- csharp-generics-modernSkill
- csharp-guard-clausesSkill
- csharp-json-source-generationSkill
- csharp-language-versionsSkill
- csharp-logging-diagnosticsSkill
- csharp-lspSkill
- csharp-modern-typesSkill
- csharp-nullabilitySkill
- csharp-nullable-migrationSkill
- csharp-nunitSkill
- csharp-pattern-matchingSkill
- csharp-performanceSkill
- csharp-polyfillsSkill
- csharp-source-generatorsSkill
- csharp-static-lambdasSkill
- csharp-string-handlingSkill
- csharp-tunitSkill
- csharp-verificationSkill
- dispatching-subagentsSkill
- dotnet-11-librariesSkill
- dotnet-analyzersSkill
- dotnet-central-package-managementSkill
- dotnet-file-based-appsSkill
- dotnet-msbuild-usingsSkill
- dotnet-multi-targetingSkill
- dotnet-project-hygieneSkill
- dotnet-runSkill
- dotnet-runtime-asyncSkill
- dotnet-test-platformsSkill
- executing-plansSkill
- performance-bounded-deduplicationSkill
- roslyn-analyzer-performanceSkill
- roslyn-discoverySkill
- roslyn-duplicate-detectionSkill
- roslyn-guard-rewritersSkill
- roslyn-rewritersSkill
- subagent-driven-developmentSkill
- tddSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 48
Do the whole migration as one change, not just the migrate step:
- Very specific: line 52
Update every place that names the .sln explicitly: CI workflow YAML (dotnet build MyRepo.sln, dotnet test MyRepo.sln), local build scripts, …
- Very specific: line 53
Search the repo for the literal .sln string (not just *.sln files) to catch references inside scripts and docs.
- Very specific: line 74
Add <Configurations>/per-project <Platform>/<BuildType> overrides only when a project genuinely needs a non-default configuration or …
- Very specific: line 98
When a folder holds both a .slnx and .slnf, commands that pick a file implicitly use the .slnx.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
.NET solution files: .slnx is the only format to create or keep
.sln is yesterday's news. .slnx is the only solution format to create in a new repo, and any .sln found in a repo you're already touching is legacy to migrate on sight, not an acceptable alternative to leave alone. There is no case for a new .sln file.
Why
- Plain XML, not a bespoke text format — readable, diffable, and mergeable like any other project file.
- No GUIDs.
.slnassigns a GUID per project and per build-configuration line; two branches adding projects independently collide on those lines constantly..slnxhas none of that. - No configuration/platform matrix noise.
.slnspells out every{GUID}.Debug|Any CPU.ActiveCfg = ...line per project per config..slnxinfers Debug/Release and the platform list from the referenced projects; you only add<Configurations>/per-project overrides when a project genuinely needs to diverge. - Folders are just nesting, not synthetic solution-folder GUID entries.
Current tooling support:
- .NET SDK CLI:
slnxsupport landed in .NET SDK 9.0.200 (Introducing SLNX support in the .NET CLI). Starting in .NET 10,dotnet new slngenerates.slnxby default; pass--format slnto opt back into the legacy format if a specific tool genuinely can't read.slnxyet. - MSBuild: solution builds against
.slnxare supported from MSBuild 17.12;before.<name>.slnx.targets/after.<name>.slnx.targetscustomization files need MSBuild 17.14+. - Visual Studio: opens/builds
.slnxnatively; VS 2026 adds a Default Solution File Format option (Tools > Options > Projects and Solutions > General) to make.slnxthe default for new solutions. - Rider:
.slnxsupport shipped in the 2024.2.6/2024.3 line (JetBrains blog, Support for SLNX Solution Files) — recent Rider versions are fine; anything older is not. - VS Code C# Dev Kit: activates on and works with
.slnxworkspaces; if a specific old Dev Kit build doesn't, updating the extension is the fix, not reverting to.sln.
New solutions
dotnet new sln -n MyRepo # .slnx by default on .NET 10 and .NET 11 SDKs
dotnet new sln -n MyRepo --format slnx # explicit, same resultdotnet new sln --help shows -f|--format <sln|slnx> with Default: slnx on .NET 10 and .NET 11 SDKs. A brand-new solution is just:
<Solution>
</Solution>Never pass --format sln for a new solution unless a named, specific tool in the repo's pipeline cannot yet read .slnx — and if you hit that, treat it as a reason to upgrade or replace the tool (see Gotchas), not a reason to standardize on .sln.
Migrating an existing .sln
dotnet sln MyRepo.sln migrateThis generates MyRepo.slnx next to the .sln, printing .slnx file .../MyRepo.slnx generated. and producing valid XML, including an inferred <Configurations> block with the platforms the old file declared.
Do the whole migration as one change, not just the migrate step:
- Run
dotnet sln <file>.sln migrate. - Delete the
.slnin the same commit. Never keep both — they drift the moment someone edits only one, and see the build-error gotcha below. - Update every place that names the
.slnexplicitly: CI workflow YAML (dotnet build MyRepo.sln,dotnet test MyRepo.sln), local build scripts, README "getting started" snippets,global.json-adjacent tooling or wrapper scripts, IDE launch/run configs that hardcode the path. - Search the repo for the literal
.slnstring (not just*.slnfiles) to catch references inside scripts and docs.
Format essentials
<Solution>
<Folder Name="/src/">
<Project Path="src/MyApp/MyApp.csproj" />
<Project Path="src/MyApp.Core/MyApp.Core.csproj" />
</Folder>
<Folder Name="/tests/">
<Project Path="tests/MyApp.Tests/MyApp.Tests.csproj" />
</Folder>
<Folder Name="/">
<File Path="README.md" />
<File Path="Directory.Build.props" />
</Folder>
</Solution><Folder Name="/src/">is inferred automatically from the project's path when youdotnet sln add— you don't hand-place projects into folders for the common case.- Add
<Configurations>/per-project<Platform>/<BuildType>overrides only when a project genuinely needs a non-default configuration or platform; the default (Debug/Release, no platform matrix) is inferred and needs no XML. - Solution items (files with no build action, e.g.
README.md) go under<File Path="..."/>inside a folder, same as.sln"Solution Items".
Editing: prefer the CLI, hand edits are fine when you need them
dotnet sln MyRepo.slnx add src/NewProject/NewProject.csproj
dotnet sln MyRepo.slnx add src/NewProject/NewProject.csproj -s src # into an explicit solution folder
dotnet sln MyRepo.slnx remove src/OldProject/OldProject.csproj
dotnet sln MyRepo.slnx listThe CLI writes project paths relative to the .slnx file, with forward slashes, even when invoked from a subdirectory or given an absolute path on input (e.g. src/Demo.Lib/Demo.Lib.csproj). Folders (<Folder Name="/src/">) are created and removed automatically as projects are added/removed.
Because .slnx is plain, well-formed XML, a hand edit (adding a <Project Path="..."/> line) is low-risk and fine for quick fixes — just keep the same relative-forward-slash convention the CLI uses, and prefer the CLI when you can, since it also validates names (invalid Windows filenames, duplicate names, length limits) for you.
Solution filters (.slnf)
.slnf is not a legacy format and is not replaced by .slnx. It serves a different purpose: a named subset of a solution's projects, so you can open, build or test part of a large repo (for example Core.slnf or Windows.slnf). Use it alongside the .slnx, which stays the single source of truth for the full project list. Point every filter at the .slnx.
dotnet new slnf -n MyFilter -s MyRepo.slnxcreates the filter file, pointing at the given parent solution (-s|--parent-solution, defaulting to<name>.slnx). Theslnftemplate is new in .NET 11 — it doesn't exist on the .NET 10 SDK.dotnet sln <file>.slnf list|add|removeall work directly against a.slnf, editing itsprojectsarray. Support for.slnfwas introduced incrementally:listin .NET SDK 9.0.3xx,add/removein .NET 11.dotnet sln <file>.slnf add <path>writes the added project path with backslashes (src\\Demo.Lib\\Demo.Lib.csproj) even when run on Linux —.slnfis JSON that historically follows Windows path conventions; don't "fix" this to forward slashes by hand, and don't be surprised by it in a diff.dotnet build MyFilter.slnf/dotnet test MyFilter.slnfwork like they do against a solution file directly.- When a folder holds both a
.slnxand.slnf, commands that pick a file implicitly use the.slnx. Always name the filter explicitly (dotnet build Core.slnf) when you mean the subset.
Gotchas
- Both
.slnand.slnxin the same folder → build fails.dotnet buildwith no argument in a folder containing both reportsMSB1011: Specify which project or solution file to use because this folder contains more than one project or solution file.This is the concrete failure mode of keeping both during a slow migration — don't; delete the.slnin the same change as themigrate. - Tooling that only reads
.sln. Some third-party build/CI tasks, older MSBuild/Visual Studio installs, and older VS Code C# Dev Kit builds may not understand.slnxyet. Check by grepping CI workflows and build scripts for.slnusage and by checking the tool's own changelog/version requirements (MSBuild 17.12+, SDK 9.0.200+ CLI, current Rider/VS Code Dev Kit). The fix is to upgrade the tool, not to keep a.slnaround for it — a stray.slnimmediately reintroduces the drift risk above. dotnet sln/dotnet build/dotnet testwith no explicit file search the current directory and use the one solution/filter file they find; if none or more than one exist, they error rather than guess. Always pass the file explicitly in CI scripts even when there's only one, so the script doesn't silently start failing the day a second file appears.
Checklist
- New repo:
dotnet new slnused with no--format slnoverride — result is.slnx - Existing
.slnfound while working in a repo: migrated withdotnet sln <file>.sln migrate,.slndeleted in the same change - No repo has both
.slnand.slnxside by side after the change - CI workflows, build scripts, README snippets, and
dotnet build/dotnet testinvocations updated to the.slnxfilename - Projects added/removed via
dotnet sln add|remove, not error-prone manual GUID-style edits (hand edits of the simple XML are fine when the CLI isn't handy) - Any
.slnffiles point at the.slnx, not a leftover.sln - Any tool that still requires
.slnis flagged for upgrade, not used as a reason to keep.slnin the repo
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

