关于解决方案文件sln的说明,官方文档已经说的很清楚的,这里不再重复,只说几个细节的地方

一个完整的sln文件

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 16
VisualStudioVersion = 16.7.30413.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MQTTnetServer", "MQTTnetServer\MQTTnetServer.csproj", "{B0C01277-BBF1-4A23-B700-4E4B6954A3B7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MQTTnetClient", "MQTTnetClient\MQTTnetClient.csproj", "{0CCD1198-FD33-48E7-8B5A-506135EAF0E4}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{B0C01277-BBF1-4A23-B700-4E4B6954A3B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{B0C01277-BBF1-4A23-B700-4E4B6954A3B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{B0C01277-BBF1-4A23-B700-4E4B6954A3B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{B0C01277-BBF1-4A23-B700-4E4B6954A3B7}.Release|Any CPU.Build.0 = Release|Any CPU
		{0CCD1198-FD33-48E7-8B5A-506135EAF0E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{0CCD1198-FD33-48E7-8B5A-506135EAF0E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{0CCD1198-FD33-48E7-8B5A-506135EAF0E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{0CCD1198-FD33-48E7-8B5A-506135EAF0E4}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
	GlobalSection(ExtensibilityGlobals) = postSolution
		SolutionGuid = {4E37268A-53FA-4F12-8CC2-3763A411C11E}
	EndGlobalSection
EndGlobal

VisualStudioVersion 的第二位始终是,不会随着版本的升级而改变,也就是在整个Visual Studio 2019 生命周期内,前两位始终是16.0。以下是微软官方的回应:

$(VisualStudioVersion) is expected to be 16.0 for the full Visual Studio 2019 release cycle. This is somewhat confusing, but it is used to construct paths which have the same property: 16.0 for all Visual Studio 16.x.y

参考