Introduction
A .sln file is a solution for Microsoft’s
Visual Studio: the list of projects
that make up a piece of software, such as a C# or C++
project, with the build configurations they share,
like Debug and Release for each platform. Opening the solution opens all its projects
together, and building it builds them in the right order. The projects keep their own
settings in their own files.
Structure
A solution is a text file, usually saved as UTF-8 with a byte order mark. It opens with
a line naming the format version, then comments and settings recording which Visual
Studio wrote it. Each project has a Project block giving a GUID for the kind
of project, its name, its path and its own GUID. A Global block follows,
made of GlobalSection blocks: the solution’s configurations, how each one
maps to each project’s configurations, and other settings.
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "App\App.csproj", "{6F1D3C42-...}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
EndGlobal
Links
Software
- Visual Studio (Windows)
- JetBrains Rider (Windows, macOS, Linux)
- .NET SDK, whose
dotnet buildanddotnet slnread and change it (Windows, macOS, Linux) - MSBuild (Windows, macOS, Linux)
- Visual Studio Code, with the C# Dev Kit extension (Windows, macOS, Linux)