React-native-windows: "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.Cpp.targets" was not found.

Created on 5 Dec 2018  路  10Comments  路  Source: microsoft/react-native-windows

Environment

  1. react-native -v:
  2. npm ls rnpm-plugin-windows:
  3. npm ls react-native-windows:
  4. node -v:
  5. npm -v:
  6. yarn --version:
D:\code\react-native\windowsQuickstart>react-native -v
react-native-cli: 2.0.1
react-native: 0.57.7

D:\code\react-native\windowsQuickstart>npm ls rnpm-plugin-windows
[email protected] D:\code\react-native\windowsQuickstart
`-- (empty)


D:\code\react-native\windowsQuickstart>npm ls react-native-windows
[email protected] D:\code\react-native\windowsQuickstart
`-- UNMET DEPENDENCY [email protected]

npm ERR! missing: [email protected], required by [email protected]

D:\code\react-native\windowsQuickstart>node -v
v11.2.0

D:\code\react-native\windowsQuickstart>npm -v
6.4.1
D:\code\react-native\windowsQuickstart>yarn --version
1.12.1

Then, specify:

  • Target Platform: UWP

  • Target Platform Version(s):

  • Target Device(s): Mobile

  • Development Operating System: Windows

  • Visual Studio Version: Visual Studio 2017

  • Build Configuration:

Steps to Reproduce


I followed the instruction on https://github.com/Microsoft/react-native-windows/blob/master/docs/GettingStarted.md, but I got the following error when I run react-native run-windows.

D:\code\react-native\windowsQuickstart> react-native run-windows
Restoring NuGet packages
Building D:/code/react-native/windowsQuickstart/windows/windowsQuickstart.sln
Found MSBuild v15.0 at C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin
Building Solution: D:/code/react-native/windowsQuickstart/windows/windowsQuickstart.sln
Build configuration: Debug
Build platform: x86
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(2128,3): error MSB4019: The imported proj
ect "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.Cpp.targets" was not found.
 Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [D:\code\react-native\windowsQuickstart\node_modules\react-n
ative-windows\Yoga\csharp\Yoga\Yoga.Universal.vcxproj]
Build failed with message Error: Command failed: "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild.exe" "D:/code/react-native/windowsQuickstart/windows/windowsQuickstart.sln" /clp:NoSummary;NoItemAndPropertyList;Verbosity=quiet /nologo /p:Configuration=Debug /p:Platform=x86 /p:AppxBundle=Never /p:PlatformToolset=v141 /p:VisualStudioVersion=15.0. Check your build configuration.

I also have tried the tips mentioned https://github.com/Microsoft/testfx/issues/314, here are some snapshot of my environment.

image

image

image

Expected Behavior

(Write what you thought would happen.)

Actual Behavior

(Write what happened. Add screenshots!)

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

.NET Invalid Triage

All 10 comments

Try installing C++ Universal Windows Platform Tools.

@rozele, Hi, I installed the C++ Universal Windows Platform Tools, but still did not work.
image
Same error: The imported proj ect "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.Cpp.targets" was not found.
The directory "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\WindowsXaml" does not exist after installed C++ Universal Windows Platform Tools

Did you ever figure this out @liudonghua123

@dvshnt I still have such problem. It's really wired.

After installing Windows 10 SDK 10.0.14393.0 I was able to get past this error, and start the windows application up.

I am also experiencing this issue. I do have Windows 10 SDK 10.0.14393.0 as @MANTENN suggested. But this is still not doing the trick. Any other suggestions?

I had a similar error and Microsoft.VisualStudio.ComponentGroup.Windows10SDK.16299 seemed to fix it for me.

We are not investing in new features or lower priority bug fixes on the C# implementation of React Native for Windows (previously known as "vCurrent"). All investment moving forward is in the C++ infrastructure (previously known as "vNext") and that is the only option as of 0.61 (and was the default as of 0.60). If this issue is still relevant on the modern implementation please open a new issue. If this issue is of significant severity for a vCurrent app and vNext is not an option, re-open with justification.

I ran into this same issue with C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.Cpp.targets missing. My issue ended up being that VS Build Tools 2017 was installed on my machine, and its version of MSBuild was being used. Uninstalling it resolved the issue for me.

Was this page helpful?
0 / 5 - 0 ratings