Although the csproj file evolved and simplified a lot over time, the Visual Studio solution file (.sln) remained an ugly file format full of magic GUIDs. With the latest .NET 9 SDK(9.0.200), we finally got an alternative; a new XML-based solution file(.slnx) got introduced in preview.
So say goodbye to this ugly sln file:
And meet his better looking slnx brother instead:
To use this feature we first have to enable it:
- Go to Tools -> Options -> Environment -> Preview Features
- Check the checkbox next to Use Solution File Persistence Model
Now we can migrate an existing sln file to slnx using the following command:
dotnet sln migrate AICalculator.sln
.slnx file D:\Projects\Test\AICalculator\AICalculator.slnx generated.
Or create a new Visual Studio solution using the slnx format:
dotnet new sln --format slnx
The template "Solution File" was created successfully.
The new format is not yet recognized by VSCode but it does work in Jetbrains Rider:
Nice!