项目文件中有一个名为Globals的PropertyGroup,其中包含以下设置:
<PropertyGroup Label="Globals">
...
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.14393.0</WindowsTargetPlatformMinVersion>
...
</PropertyGroup>
我没有找到任何有关如何在MSBuild命令行中设置这些内容的文档。
msbuild xx.csproj/xx.sln /t:build /p:WindowsTargetPlatformVersion=xx;WindowsTargetPlatformMinVersion=xx
... 更多细节请参考stijn评论中的文档。 - LoLance