FeMaiden
FeMaiden

Reputation: 121

The imported project "C:\Microsoft.Cpp.Redirect.14.props" was not found

I was editing a .vcxproj file while converting it from VS2012 to VS2017 and now the project doesn't load in VS2017. Here is the error message:

Unable to read the project file "Manager.vcxproj". C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Redirect.props(27,3): The imported project "C:\Microsoft.Cpp.Redirect.14.props" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

I think the error is related to these lines in the project file:

 <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>

However, other projects in my solution use the same import paths and still load correctly. Are these lines what is causing the issue? If so, what is the correct path and why do my other projects work when this path is used?

Upvotes: 3

Views: 3030

Answers (1)

FeMaiden
FeMaiden

Reputation: 121

The error can be fixed by adding the below code segment after the "Globals" PropertyGroup closes:

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

While the project can load in VS2012 without this line, it will not in VS2017.

Upvotes: 8

Related Questions