Visual Studio 2012 專案格式(.sln/.vcxproj)預設不被 VS2010 識別。透過手動修改版本號與工具集標籤,可讓 VS2010 開啟並編譯(前提:代碼未使用 C++11/VC++11 專屬特性)。
用記事本開啟,修改前兩行:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
改為:
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
用記事本開啟,刪除兩處 <PlatformToolset>v110</PlatformToolset> 標籤(通常在 PropertyGroup Label="Configuration" 區塊)。
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<PlatformToolset>v110</PlatformToolset> <!-- 刪除此行 -->
</PropertyGroup>
若專案有多組組態,需全部刪除。
若專案檔中找不到 v110,可能為舊版遷移專案。改用專案屬性介面:
auto, lambda, nullptr 等)或 VS2012 專屬庫。需改寫為 C++03 相容寫法或升級編譯器。