πŸ’‘ Developer Tips / Migrate .sln to the New XML .slnx Format
dotnet

Migrate .sln to the New XML .slnx Format

January 6, 2026 β€’ 2 min read
← Back to Tips
The new .slnx format is XML-based, making solution files more readable and friendlier in diffs/merge conflicts compared to the traditional GUID-heavy .sln format.

πŸ“‹ Prerequisites

  • .NET SDK 9.0.200+ installed
  • An existing .sln file in your repo

Quick CLI Migration (Recommended)

The easiest way to migrate is using the dotnet CLI command:

# If there is exactly one .sln in the current folder:
dotnet sln migrate

# If you have multiple .sln files, be explicit:
dotnet sln YourSolutionName.sln migrate

Verify the Migration

After migration, a new .slnx file will be generated next to the .sln (keep the old .sln as an easy rollback). Build to confirm everything still compiles:

dotnet build

Switch to .slnx in Git

Once your team and CI are happy with the new format, you can switch over:

git rm YourSolutionName.sln
git add YourSolutionName.slnx
git commit -m "Migrate solution to .slnx format"

πŸ’‘ Important Notes

  • Solution Filters: If you use solution filters (.slnf), update them to reference the new .slnx, otherwise they may still point at the old .sln
  • Team Coordination: Make sure your entire team has .NET SDK 9.0.200+ before switching
  • CI/CD: Update your build pipelines to ensure they support the .slnx format

Visual Studio Migration (GUI)

You can also migrate inside Visual Studio (support started as a preview feature and is available in newer versions):

  1. If your Visual Studio version shows it, enable:
    Tools β†’ Options β†’ Preview Features β†’ "Use Solution File Persistence Model"
  2. Then export the solution as .slnx:
    Solution Explorer β†’ right-click solution β†’ File β†’ Save Solution As… β†’ "Xml Solution File (*.slnx)"

πŸš€ Extra Trick (New Repos)

Microsoft is moving toward defaulting dotnet new sln to .slnx in newer SDK behavior. If you rely on .sln, keep an eye on your SDK versions and team tooling.

πŸ“š Official Documentation

πŸ’¬ Comments & Reactions