生成失败,出现错误MSB4226:导入的项目| 反应本地窗口

Sathis Sakthivel

Visual Studio 2017和我已经安装了所有必需的构建工具。但是当我运行react-native运行窗口时。它显示错误,如下面的代码

C:\native\myapp>react-native run-windows
Restoring NuGet packages
Building C:/native/myapp/windows/com.tet.windows.sln
Found MSBuild v15.0 at C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin
Building Solution: C:/native/myapp/windows/com.tet.windows.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:\native\myapp\windows\com.tet.windows\com.tet.windows.csproj(171,11): error MSB4226: The imported project "C:\Program
 Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.CSha
rp.targets" was not found. Also, tried to find "Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.CSharp.targets" i
n the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are
defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\msbuild.exe.Config". Confir
m that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Current.targets(1
08,3): error MSB4019: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\
VC\VCTargets\Platforms\Win32\Platform.targets" was not found. Confirm that the path in the <Import> declaration is corr
ect, and that the file exists on disk. [C:\native\myapp\node_modules\react-native-windows\Folly\Folly.vcxproj]
Build failed with message Error: Command failed: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild.exe" "C:/native/myapp/windows/com.tet.windows.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.
认真地

由于开始使用VS 2019,我也遇到了类似的问题。它只说到了此文件:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\msbuild.exe.Config

打开它,然后找到该节点中的内容:

<projectImportSearchPaths>
      <searchPaths os="windows">

更改值以准确导航您的MSBuild现在所在的位置。就我而言,更改为:

<projectImportSearchPaths>
      <searchPaths os="windows">
        <property name="MSBuildExtensionsPath" value="$(MSBuildProgramFiles32)\Microsoft Visual Studio\2019\Enterprise"/>
        <property name="MSBuildExtensionsPath32" value="$(MSBuildProgramFiles32)\Microsoft Visual Studio\2019\Enterprise"/>
        <property name="MSBuildExtensionsPath64" value="$(MSBuildProgramFiles32)\Microsoft Visual Studio\2019\Enterprise"/>
        <property name="VSToolsPath" value="$(MSBuildProgramFiles32)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v$(VisualStudioVersion)"/>
      </searchPaths>
    </projectImportSearchPaths>

值:Microsoft Visual Studio \ 2019 \ Enterprise \ MSBuild \ Microsoft \ VisualStudio

希望能帮助到你。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

反应本地错误,登录

本地窗口无法出现

反应本地Flex项目对齐

pod安装失败,反应为本地0.44

反应本地android清单合并失败

导入本地字体以创建反应应用程序项目

运行干净的本地反应项目时出错

反应本地轮播项目活动指数

反应本地导航器渲染方法错误

反应本地和流错误消息

反应本地相机导致gradle构建错误

如何使用公共组件创建本地反应库项目,并在本地导入该项目

尝试从Firebase使用FacebookAuthProvider进行连接,但出现错误。反应本地

创建本地反应项目时的命令行错误

在开发过程中如何将本地反应库与本地反应项目链接?

反应本地-绝对导入package.json中的别名

用星号导入在本地反应中有什么作用?

Facebook的SDK原因作出反应本地构建失败

Azure DevOps生成失败-MSB4226-Analysis Services

如何清理我的本地反应项目以备份它?

反应本地人无法识别项目

反应本地项目符号列表使用柔性包装

用观察者错误反应本地`npm start`

执行失败的任务“:应用程序:compileDebugJavaWithJavac”。在运行作出反应本地项目

我可以在父窗口中设置本地存储项目吗?

反应本地从本地数据库获取图像位置数据错误意外令牌“,”

反应本地Google登录失败-错误代码16(已取消)

导入模态弹出窗口时出现错误

反应下一个应用程序获取错误窗口未在反应位置选择器中定义