项目文件在名为Globals的PropertyGroup中具有以下设置:
<PropertyGroup Label="Globals">
...
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.14393.0</WindowsTargetPlatformMinVersion>
...
</PropertyGroup>
我找不到任何有关如何使用MSBuild在命令行上进行设置的文档。
答案 0 :(得分:0)
使用简单的/p
参数可以解决问题。使用如下命令:
msbuild xx.csproj/xx.sln /t:build /p:WindowsTargetPlatformVersion=xx;WindowsTargetPlatformMinVersion=xx
(应在一行中)可以在运行时指定目标版本。
注意:要运行上述命令,您应确保将要指定的Windows sdk版本安装在计算机中。