visual studio 2010 默认的sdk是自带的v7.0a,当工程比较多的时候,挨个设置sdk的版本比较麻烦:
开始以为默认设置隐藏在注册表中,搜索后一无所获。感觉应该是在配置文件中,找了好几天.....
在这几个文件夹中的文件中都有个配置文件,Microsoft.Cpp.xxx(指平台名称,比如Win32).default.props,内容:
<!--
***********************************************************************************************
Microsoft.Cpp.Win32.default.props
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
Copyright (C) Microsoft Corporation. All rights reserved.
***********************************************************************************************
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PlatformShortName>x86</PlatformShortName>
<PlatformArchitecture>32</PlatformArchitecture>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">$(DefaultWin32PlatformToolset)</PlatformToolset>
<PlatformToolset Condition="'$(PlatformToolset)' == ''">Windows7.1SDK</PlatformToolset>
<IntDir Condition="'$(IntDir)'=='' AND '$(IntermediateOutputPath)'!=''">$(IntermediateOutputPath)</IntDir>
<IntDir Condition="'$(IntDir)'=='' AND '$(IntermediateOutputPath)'==''">$(Configuration)/</IntDir>
<OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' != ''">$(SolutionDir)$(Configuration)/</OutDir>
<OutDir Condition="'$(OutDir)'=='' AND '$(SolutionDir)' == ''">$(IntDir)</OutDir>
</PropertyGroup>
</Project>
这样,每次新建的工程的默认sdk都是v7.1。 “PlatformToolset”的名称就是其配置文件夹的名称。
(我安装了vs2008、2010和sdk7.1,所以有三个配置文件夹)