none
Microsoft.Cpp.Default.props not in correct folder! Help needed! RRS feed

  • Question

  • After working through the "VCTargetPaths" registry value missing and MSBuild unable to "read it" I am now seeing the following error message when I go to build Apache QPID C++.

    "error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\V4.0\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk."

    I can confirm that MSBuild does not exist in "Program Files(x86)" but does in "Program Files".  The version in "Program Files" does not have a folder/directory named "Microsoft.Cpp\V4.0".  But "Microsoft.Cpp.Default.props" exists in only in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets".

    I have repaired Visual Studio installs and have (unsuccessfully) tried to repair .NET.

    Any help would be appreciated!

    Paul

    Friday, October 27, 2017 7:26 PM

Answers

  • Joyce,

    Sorry for late reply.

    Your suggestion did highlight that there is an issue with the Windows QPID distribution of CMAKE which I have been working through on my own.

    The basic issue remains.  But perhaps it is rhetorical that I should expect or ask for a product that has been around as long as Visual Studio has been to have better installation and repair facilities.  

    It seems that product quality, especially stability of the platform, is something to be addressed in the next release.  Without a strict mandate to use Visual Studio I would have likely approached this development in Eclipse looking to the support of the gcc community.

    Paul

    • Marked as answer by PaulFlores Thursday, May 23, 2019 3:39 PM
    Friday, November 10, 2017 3:25 PM

All replies

  • Are you following the instructions in the INSTALL-WINDOWS.txt file of Apache QPID C++? That file says it is for "Microsoft Visual Studio 2012 (VC11)". It will need some changes for Visual Studio Community 2017.

    In particular, section 3 says you should run this command: cmake -G "Visual Studio 10" ..

    I think you need to change that to "Visual Studio 15 2017" as described in Visual Studio 15 2017 — CMake 3.10.0-rc3 Documentation.

    If you are instead using Visual Studio's built-in support for CMake projects, then I don't know how that works.

    Saturday, October 28, 2017 10:03 AM
  • Hi,

    Welcome to MSDN forum.

    >>After working through the "VCTargetPaths" registry value missing and MSBuild unable to "read it" I am now seeing the following error message when I go to build Apache QPID C++.

    Have you make any changes to registry editor?

    The location for Microsoft.Cpp.Default.props:

    Visual studio 2015: drive:\Program Files (x86)\MSBuild\Microsoft.Cpp (x86)\v4.0\v140\

    Visual studio 2017: drive:\Program Files (x86)\Microsoft Visual Studio\year\edition\Common7\IDE\VC\VCTargets\

    Contains the primary target files (.targets) and property files (.props) that are used by the targets. By default, the $(VCTargetsPath) macro references this directory.

    >>I have repaired Visual Studio installs and have (unsuccessfully) tried to repair .NET.

    You can use the tool to repair .net framework.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 30, 2017 9:25 AM
  • Hi Joyce,

    Thanks for your comments but unfortunately your insights into as to where Microsoft.Cpp.Defaults.props should reside only further highlight my frustrations. 

    The main frustration is with having to manually update the registry.  I, perhaps incorrectly, am making the assumption that insuring that registry values are properly setup is the  the purview of an installer or of repairing an installation.  Does that seem inappropriate or has configuring and/or repairing Visual Studio to work correctly devolved to manually making changes to items as fundamental as registry values?

    As to the use of the .NET Framework repair tool I was remiss in not communicating that it was in fact through the use of that tool that I was unsuccessful at repairing the framework.  In that regard I keep receiving a message to reinstall the .NET 4.5 framework and then the subsequent message that the framework is already installed and it all just may be "locked down" by policy.

    I will attempt to manually up VCTargets to the location of Microsoft.Cpp.Defaults.props but I am not feeling confident that it will resolve issues.

    I received the following error message as a result of manually updating the registry values and attempting to build.

    "Microsoft.Cpp.Current.targets(64,5): error MSB4062: The "SetEnv" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Build.CppTasks.Common.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask."

    • Edited by PaulFlores Monday, October 30, 2017 2:45 PM
    Monday, October 30, 2017 2:24 PM
  • Hi,

    Thank you for the update.

    What's your original problem before you update registry? (Making changes in registry editor is not recommended.)

    Please try to repair or reinstall visual studio 2017 and then build your project, check it if the issue persists. After this, if the issue persists, upload the error message.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, October 31, 2017 9:08 AM
  • Hi Joyce,

    Original problem was unable to compile C++ project (Apache QPID and Proton) kept receiving MSBuild errors regarding VCTarget.  Per forum search results I updated registry values.

    Background information.  I had originally loaded Visual Studio Code but that seemed to be more of a hassle especially with MSBuild and the registry edits ("hack") suggested.  So  I uninstalled everything that had to do with Visual Studio and reinstalled Visual Studio Community. 2017.

    I have tried repairing Visual Studio Community a number of times along with uninstalling and reinstalling numerous times to no avail.  The Fix .NET tool does not resolve this issue and sends log.

    The error message which follows persists!

    Anything else I should try?

    Paul

    --------------- error message -------------

    Failed to run MSBuild command:

        C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe

      to get the value of VCTargetsPath:

        Microsoft (R) Build Engine version 4.7.2053.0
        [Microsoft .NET Framework, version 4.0.30319.42000]
        Copyright (C) Microsoft Corporation. All rights reserved.

        Build started 10/31/2017 11:22:29 AM.
        Project "C:\Users\pflores\eclipse-workspace\QPID_CPP\CMakeFiles\3.10.0-rc3\VCTargetsPath.vcxproj" on node 1 (default targets).
        C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Current.targets(64,5): error MSB4062: The "SetEnv" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Build.CppTasks.Common.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\Users\pflores\eclipse-workspace\QPID_CPP\CMakeFiles\3.10.0-rc3\VCTargetsPath.vcxproj]
        Done Building Project "C:\Users\pflores\eclipse-workspace\QPID_CPP\CMakeFiles\3.10.0-rc3\VCTargetsPath.vcxproj" (default targets) -- FAILED.

        Build FAILED.

        "C:\Users\pflores\eclipse-workspace\QPID_CPP\CMakeFiles\3.10.0-rc3\VCTargetsPath.vcxproj" (default target) (1) ->
        (SetBuildDefaultEnvironmentVariables target) ->
          C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Current.targets(64,5): error MSB4062: The "SetEnv" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Build.CppTasks.Common.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\Users\pflores\eclipse-workspace\QPID_CPP\CMakeFiles\3.10.0-rc3\VCTargetsPath.vcxproj]

            0 Warning(s)
            1 Error(s)

        Time Elapsed 00:00:00.13


      Exit code: 1
    Tuesday, October 31, 2017 5:37 PM
  • Hi,

    >>Failed to run MSBuild command:  C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe   to get the value of VCTargetsPath:

    Does your project created in the earlier version of visual studio?

    Msbuild command used in visual studio 2017 is C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe

    In visual studio 2015 is C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe

    Please create a new default project in visual studio 2017 to check if the issue is related to visual studio itself or your project.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, November 1, 2017 9:37 AM
  • Joyce,

    Sorry for late reply.

    Your suggestion did highlight that there is an issue with the Windows QPID distribution of CMAKE which I have been working through on my own.

    The basic issue remains.  But perhaps it is rhetorical that I should expect or ask for a product that has been around as long as Visual Studio has been to have better installation and repair facilities.  

    It seems that product quality, especially stability of the platform, is something to be addressed in the next release.  Without a strict mandate to use Visual Studio I would have likely approached this development in Eclipse looking to the support of the gcc community.

    Paul

    • Marked as answer by PaulFlores Thursday, May 23, 2019 3:39 PM
    Friday, November 10, 2017 3:25 PM