Author Topic: [SOLVED] Visual Studio 2017 v15.9.4 - Microsoft.Cpp.Default.props not found  (Read 2388 times)

Allan

  • Community Member
  • Posts: 17
  • Hero Points: 0
Slickedit Version:  SE Pro 2018 v23.0.0.11 64-bit on Windows.
Problem:  I am unable to compile/build a c++ file created using Visual Studio Community 2017 Version 15.9.4.
Error Message:   
Quote
E:\Dev\vsTest\vs-test\vs-test.vcxproj(28,3): error MSB4019: The imported project "E:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Background:  While going through the Boost Getting Started on Windows tutorial, I discovered that I can run the example code in Visual Studio, but I cannot run the code in SE.  So, I created a VC++ console application project named vs-test that contains the default "Hello World" generated code.  When I click on Build --> Build for vs-test, I get the above error message.
Question:  After reading the SE User Guide, I don't see what, if anything, I am doing wrong.  Does SE 2018 Pro support c++ projects created using VS 2017?  Is there something I need to do?

Thank you.
« Last Edit: December 19, 2018, 09:39:34 pm by Allan »

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Visual Studio 2017 Version 15.9.4 - Microsoft.Cpp.Default.props not found
« Reply #1 on: December 18, 2018, 01:46:38 pm »
Are you doing a Project Build or are you doing a single file Compile?

When I have seen this before, it usually means the environment variables aren't quite right for this type of project.  Visual Studio 2017 C++ is definitely supported, but it is possible that there is an additional environment variable required or a different Registry lookup that needs to be done for the Community version.  I will download Community version and test to see what extra setup needs to be done for that.

UPDATE:
I downloaded Visual Studio Community 2017 15.9.4, and created a sample C++ project and then loaded it into SlickEdit v23.0 release.  I was not able to reproduce the error message you encountered, everything built correctly from just default settings.  I suspect something is not configured correctly in the environment.  If you run SET in the Build Window, what is set for: 
VCToolsInstallDir
VisualStudioVersion
« Last Edit: December 18, 2018, 02:42:05 pm by Lee »

Allan

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: Visual Studio 2017 Version 15.9.4 - Microsoft.Cpp.Default.props not found
« Reply #2 on: December 18, 2018, 03:49:09 pm »
I ran SET in the Build window of SE and I do not have a VCToolsInstallDir or VisualStudioVersion.

Yesterday, I updated Visual Studio (VS) maybe these variables didn't get set. 

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Visual Studio 2017 Version 15.9.4 - Microsoft.Cpp.Default.props not found
« Reply #3 on: December 18, 2018, 04:12:19 pm »
Did you open the Visual Studio solution with SlickEdit or do you just have the CPP files open with no workspace?

Allan

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: Visual Studio 2017 Version 15.9.4 - Microsoft.Cpp.Default.props not found
« Reply #4 on: December 18, 2018, 04:39:29 pm »
I created the solution using Visual Studio and then I opened the VS solution using SlickEdit.

Update:  I launched SE from the Developer Command Prompt for VS 2017 and I was to successfully build and execute vs-test with no errors.
« Last Edit: December 19, 2018, 01:59:19 am by Allan »

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Visual Studio 2017 Version 15.9.4 - Microsoft.Cpp.Default.props not found
« Reply #5 on: December 19, 2018, 01:30:39 pm »
That's definitely an issue with the environment setup.  It should be able to detect the environment from the solution file and the registry without resorting to that.  Could you post the solution file so I can take a look, there may be a clue in there.

Allan

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: Visual Studio 2017 Version 15.9.4 - Microsoft.Cpp.Default.props not found
« Reply #6 on: December 19, 2018, 04:03:29 pm »
Attached is the solution in a 7-zip file.  It's named vs-test.7z.  HTH.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Visual Studio 2017 Version 15.9.4 - Microsoft.Cpp.Default.props not found
« Reply #7 on: December 19, 2018, 04:58:27 pm »
Thanks for the entire sample.  I loaded in a test environment with a default config, it loaded and built without any issues.  Do you have any older versions of Visual Studio installed?  Also check the existing PATH environment variable.  It is possible that it is maybe picking up an older devenv or msbuild from the PATH environment variable and not searching for the newer build environment.

Allan

  • Community Member
  • Posts: 17
  • Hero Points: 0
Solution:  Remove or redirect MSBuild path.
Discussion: After reviewing my user and system path environment variables, I determined that the MSBuild path was causing the problem.  In my user environment variable settings, I found an MSBuild variable defined and being used in the user path environment variable (%MSBuild%\v4.0.30319 => C:\Windows\Microsoft.NET\Framework64\v4.0.30319).  I removed this path, launched SE, and I was able to build and execute the vs-test program.
Quote
MSBuild is now installed as part of Visual Studio rather than as part of the .NET Framework. . .MSBuild is now installed directly under %ProgramFiles%—for example, in C:\Program Files\MSBuild\. See https://docs.microsoft.com/en-us/visualstudio/msbuild/what-s-new-in-msbuild-12-0?view=vs-2015&viewFallbackFrom=vs-2017 for further information.

After removing the path, I located my MSBuild path at C:\Program Files (x86)\MSBuild [Note: I also found a C:\Program Files\MSBuild but it contains only Windows Workflow Foundation files].  I changed my MSBuild path to C:\Program Files (x86)\MSBuild\15.0, launched SE, and again I was able to successfully build and execute vs-test.   
I do have other Visual Studio programs installed but only the Visual Studio Community 2017 IDE.  The other VS programs shown in Programs and Features are:
  • Microsoft Visual Studio 2010 Service Pack 1
  • Microsoft Visual Studio Code
  • Microsoft Visual Studio Installer
  • Microsoft Visual Studio Tools for Applications 2015
  • and Microsoft Visual Studio Tools for Applications 2015 Language Support
Conclusion:  In my case, an older MSBuild path was generating the error message Microsoft.Cpp.Default.props not found.  The above Visual Studio programs have no effect on SE's build and execution functionality.

Thanks, Lee for your help and troubleshooting suggestions!!