前言:
-------
本来我用VS2015好好地,后来由于某种原因安装了VS2010。结果用VS2010新建了个工程后出现如下错误:
(把这个工程转换到VS2015打开没有任何错误。)
我在网上千辛万苦地寻找和摸索后终于找到了解决方案。
出错的原因:
-------
-------
本来我用VS2015好好地,后来由于某种原因安装了VS2010。结果用VS2010新建了个工程后出现如下错误:
(把这个工程转换到VS2015打开没有任何错误。)
我在网上千辛万苦地寻找和摸索后终于找到了解决方案。
出错的原因:
-------
两个版本的用户属性表(Microsoft.Cpp.Win32.user.props)冲突导致。
具体原因可以参考一下这个博客:http://blog.csdn.net/tianrolin/article/details/29208847(**先安装低版本、后安装高版本出错的网友们可以按照这个做试试。**)
解决方案:(先安装高版本、后安装低版本出错的可以按照这个试试)
-------
1. 使用记事本打开:C:\Users\<用户名>\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props。
2. 找到VS2010的默认用户属性表,往上面补充。(也就是说,原来的属性表没有的,从这个默认属性表上粘贴过去)
3. 重启VS2010。
VS2010的默认用户属性表:
-------
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup>
<ExecutablePath>$(VCInstallDir)bin;$(WindowsSdkDir)bin\NETFX 4.0 Tools;$(WindowsSdkDir)bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)\bin;$(MSBuildToolsPath32);$(VSInstallDir);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
<IncludePath>$(IncludePath)</IncludePath>
<ReferencePath>$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib</ReferencePath>
<LibraryPath>$(LibraryPath)</LibraryPath>
<SourcePath>$(VCInstallDir)atlmfc\src\mfc;$(VCInstallDir)atlmfc\src\mfcm;$(VCInstallDir)atlmfc\src\atl;$(VCInstallDir)crt\src;</SourcePath>
<ExcludePath>$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(MSBuildToolsPath32);$(VCInstallDir)atlmfc\lib;$(VCInstallDir)lib;</ExcludePath>
</PropertyGroup>
</Project>