在 Visual Studio 中创建 Apache Cordova 项目时出错
Error creating an Apache Cordova project in Visual Studio
自从我为 VS2013 Update 4 安装 Cordova Tools 后,我就遇到了这个问题。我一直在搜索并尝试了很多解决方案,但 none 个都有效。
安装后的第一时间,我找不到 Apache Cordova 模板。然后我尝试了 Stack Overflow 的解决方案,现在我可以看到它们了:
与任何人(我首先尝试使用 Blank App)我在 Visual Studio 创建项目时总是收到相同的错误消息:
The imported project 'C:\Program Files(x86)\MSBuild\Microsft\VisualStudio\v12.0\Javascript\Microsoft.VisualStudio.Javascript.Common.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. C:\Program Files (x86\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets
我为可能正在寻找相同错误的人写了这条消息。
数据:
我导航到 工具 -> 选项 -> Apache Cordova 工具 然后我明白了:
The 'AutoLoadPackagePackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file AppData\Roaming\Microsoft\VisualStudio.0\ActivityLog.xml'
这些是该文件中该错误的条目:
<entry>
<record>743</record>
<time>2015/05/01 16:08:21.331</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [AutoLoadPackagePackage]</description>
<guid>{E0F14200-4DD7-4F1A-8F2B-DA3B91F8E889}</guid>
<hr>80131604</hr>
<errorinfo>Exception has been thrown by the target of an invocation.</errorinfo>
</entry>
<entry>
<record>744</record>
<time>2015/05/01 16:08:21.369</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [AutoLoadPackagePackage]</description>
<guid>{E0F14200-4DD7-4F1A-8F2B-DA3B91F8E889}</guid>
<hr>80131604</hr>
<errorinfo>Exception has been thrown by the target of an invocation.</errorinfo>
</entry>
我也更新了Node.js。我知道 Visual Studio 和 Node.js 之间存在问题。
参考文献:
Unable to create Apache Cordova project in Visual Studio 2013
Cordova Multi-Device Hybrid Apps (Preview) for Visual Studio | Can't load project
Visual Studio/Multi Device Hybrid Apps CTP / Cordova - The imported project was not found
Error when installing Visual Studio Tools for Apache Cordova CTP3.0 in Visual Studio 2013
Visual Studio Apache Cordova Build Error - cannot find module
您似乎安装了多个版本的 VS Cordova 工具。我建议卸载所有以前版本的工具并重新开始。您可以从 here 安装 VS 2015 RC 工具。感谢您使用我们的工具。
自从我为 VS2013 Update 4 安装 Cordova Tools 后,我就遇到了这个问题。我一直在搜索并尝试了很多解决方案,但 none 个都有效。
安装后的第一时间,我找不到 Apache Cordova 模板。然后我尝试了 Stack Overflow 的解决方案,现在我可以看到它们了:
与任何人(我首先尝试使用 Blank App)我在 Visual Studio 创建项目时总是收到相同的错误消息:
The imported project 'C:\Program Files(x86)\MSBuild\Microsft\VisualStudio\v12.0\Javascript\Microsoft.VisualStudio.Javascript.Common.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. C:\Program Files (x86\MSBuild\Microsoft\VisualStudio\v12.0\CordovaTools\vs-mda-targets\Microsoft.MDA.targets
我为可能正在寻找相同错误的人写了这条消息。
数据:
我导航到 工具 -> 选项 -> Apache Cordova 工具 然后我明白了:
The 'AutoLoadPackagePackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file AppData\Roaming\Microsoft\VisualStudio.0\ActivityLog.xml'
这些是该文件中该错误的条目:
<entry>
<record>743</record>
<time>2015/05/01 16:08:21.331</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [AutoLoadPackagePackage]</description>
<guid>{E0F14200-4DD7-4F1A-8F2B-DA3B91F8E889}</guid>
<hr>80131604</hr>
<errorinfo>Exception has been thrown by the target of an invocation.</errorinfo>
</entry>
<entry>
<record>744</record>
<time>2015/05/01 16:08:21.369</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [AutoLoadPackagePackage]</description>
<guid>{E0F14200-4DD7-4F1A-8F2B-DA3B91F8E889}</guid>
<hr>80131604</hr>
<errorinfo>Exception has been thrown by the target of an invocation.</errorinfo>
</entry>
我也更新了Node.js。我知道 Visual Studio 和 Node.js 之间存在问题。
参考文献:
Unable to create Apache Cordova project in Visual Studio 2013
Cordova Multi-Device Hybrid Apps (Preview) for Visual Studio | Can't load project
Visual Studio/Multi Device Hybrid Apps CTP / Cordova - The imported project was not found
Error when installing Visual Studio Tools for Apache Cordova CTP3.0 in Visual Studio 2013
Visual Studio Apache Cordova Build Error - cannot find module
您似乎安装了多个版本的 VS Cordova 工具。我建议卸载所有以前版本的工具并重新开始。您可以从 here 安装 VS 2015 RC 工具。感谢您使用我们的工具。