Microsoft’s documentation describes the header and the loading process; the details
of the sections are taken from Microsoft’s two open-source readers of the format:
MSBuild’s SolutionFile.cs and the
vs-solutionpersistence
library. A solution keeps shared state; per-user options go in a separate binary
.suo file.
Header
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32505.173
MinimumVisualStudioVersion = 10.0.40219.1
| Line | Meaning |
|---|---|
Microsoft Visual Studio Solution File, Format Version 12.00 | The format version; 12.00 is current. MSBuild looks for it in the first two lines, rejects versions below 7 and only notes versions above the newest it knows. |
# Visual Studio Version 17 | Major version of the Visual Studio that last saved the file; it sets the version shown on the solution’s icon. |
VisualStudioVersion = … | Full version of the Visual Studio that saved it (not updated by later saves from the same major version). |
MinimumVisualStudioVersion = … | Oldest Visual Studio that can open the solution. |
Project lines
Project("{type GUID}") = "name", "path", "{project GUID}"
ProjectSection(name) = preProject|postProject
key = value
EndProjectSection
EndProject
| Field | Meaning |
|---|---|
| type GUID | The kind of project, which selects the Visual Studio package that loads it (table below). |
| name | The project’s name in the solution. |
| path | The project file, ideally relative to the solution file. |
| project GUID | The project’s own ID, used by the global sections. |
Project sections
| Section | Contents |
|---|---|
ProjectDependencies | The project’s build dependencies: one key = value line per dependency, whose key is the other project’s GUID. |
SolutionItems | A solution folder’s files. |
WebsiteProperties | Settings of a web site project, keyed configuration.name (e.g. AspNetCompiler.VirtualPath), plus ProjectReferences and TargetFrameworkMoniker. |
Project type GUIDs
The types vs-solutionpersistence knows:
| Type GUID | Project | Extension |
|---|---|---|
FAE04EC0-301F-11D3-BF4B-00C04F79EFBC | C# | .csproj |
9A19103F-16F7-4668-BE54-9A1E7A4F7556 | C# (common project system) | – |
F184B08F-C81C-45F6-A57F-5ABD9991F28F | Visual Basic | .vbproj |
778DAE3C-4631-46EA-AA77-85C1314464D9 | Visual Basic (common project system) | – |
F2A71F9B-5D33-465A-A702-920D77279786 | F# | .fsproj |
6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705 | F# (common project system) | – |
8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942 | C++ | .vcxproj, .vcxitems |
D954291E-2A0B-460D-934E-DC6B0785DB48 | Shared project | .shproj |
2150E333-8FDC-42A3-9474-1A3956D46DE8 | Solution folder | – |
E24C65DC-7377-472B-9ABA-BC803B73C61A | Web site | .webproj |
911E67C6-3D85-4FCE-B560-20A9C3E3FF48 | Executable | .exe |
54A90642-561A-4BB1-A94E-469ADEE60C69 | JavaScript | .esproj |
9092AA53-FB77-4645-B42D-1CCCA6BD08BD | Node.js | .njsproj |
151D2E53-A2C4-4D7D-83FE-D05416EBD58E | Deployment | .deployproj |
54435603-DBB4-11D2-8724-00A0C9A8B90C | Installer | .vsproj |
930C7802-8A8C-48F9-8165-68863BCCD9DD | WiX | .wixproj |
00D1A9C2-B5F0-4AF3-8072-F6C62B433612 | SQL database | .sqlproj |
0C603C2C-620A-423B-A800-4F3E2F6281F1 | U-SQL database | .usqldbproj |
182E2583-ECAD-465B-BB50-91101D7C24CE | U-SQL | .usqlproj |
F14B399A-7131-4C87-9E4B-1186C45EF12D | Reporting Services | .rptproj |
A07B5EB6-E848-4116-A8D0-A826331D98C6 | Service Fabric | .sfproj |
CC5FD16D-436D-48AD-A40C-5A424C6E3E79 | Cloud computing | .ccproj |
E53339B2-1760-4266-BCC7-CA923CBCF16C | Docker | .dcproj |
Other packages register further GUIDs; there is no complete public list.
Global sections
Global
GlobalSection(name) = preSolution|postSolution
key = value
EndGlobalSection
EndGlobal
When a solution opens, Visual Studio first processes the preSolution
sections, then the projects, then the postSolution sections. Each section
name maps (through the registry) to the package that reads it.
| Section | Lines | Meaning |
|---|---|---|
SolutionConfigurationPlatforms | Debug|Any CPU = Debug|Any CPU | The solution’s configurations; both sides are the same configuration|platform. A DESCRIPTION entry is ignored by MSBuild. |
ProjectConfigurationPlatforms | {project}.config|platform.ActiveCfg = config|platform | Which project configuration each solution configuration uses. A matching .Build.0 line means the project is built in it (no line: not built); a .Deploy.0 line also exists (named for deployment; not read by MSBuild’s older parser). |
SolutionProperties | HideSolutionNode = … | Solution properties, such as HideSolutionNode. |
NestedProjects | {child} = {parent} | Gives a project its parent (a solution folder). |
ExtensibilityGlobals | SolutionGuid = {…} | Solution-wide values for extensions, such as the solution’s GUID. |
SharedMSBuildProjectFiles | – | Shared project system properties. |
SolutionConfiguration, ProjectConfiguration, ProjectDependencies, SolutionNotes, ExtensibilityAddIns | e.g. ConfigName.0 = Debug | Older sections shown in Microsoft’s documentation example (configurations without platforms, add-ins, notes). |
Packages can store their own sections, which Visual Studio reads and writes through
IVsPersistSolutionProps.
Example
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32505.173
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App", "src\App\App.csproj", "{8CDD8387-B905-44A8-B5D5-07BB50E05BEA}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5D2A0E11-0000-4000-8000-000000000001}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8CDD8387-B905-44A8-B5D5-07BB50E05BEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CDD8387-B905-44A8-B5D5-07BB50E05BEA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CDD8387-B905-44A8-B5D5-07BB50E05BEA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CDD8387-B905-44A8-B5D5-07BB50E05BEA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8CDD8387-B905-44A8-B5D5-07BB50E05BEA} = {5D2A0E11-0000-4000-8000-000000000001}
EndGlobalSection
EndGlobal
Sources
Microsoft Learn, Project
solution (.sln) file (header lines, loading order, the example sections, the
.suo file). MSBuild source src/Build/Construction/Solution/SolutionFile.cs
(header search and version limits, Project line pattern, configuration lines,
.Build.0, nested projects, project dependencies, web site properties).
vs-solutionpersistence source SlnConstants.cs, SectionName.cs
and ProjectTypeTable.BuiltInTypes.cs (keywords, section names,
HideSolutionNode, SolutionGuid, project types). Whether
each modern section is written preSolution or postSolution
is not stated in these sources and is left out.