Unable to create Apache Cordova project in Visual Studio 2013

让人想犯罪 __ 提交于 2019-11-30 17:56:42

问题


I am having trouble creating an Apache Cordova project in Visual Studio 2013 with their new CTP1.1 patch that enables support for these project types. I had my environment working and building but I needed to get TypeScript working so I can use the DefinitelyTyped Packed which provides the types you need to hook up to the Cordova API. So I have installed this package:

DefinitelyTyped\Cordova

But I noticed that I could not add in my own TypeScript File type which then tells Visual Studio that this needs to be compiled using TypeScript. The project template comes with a index.ts which does work correctly because the project file has this in there:

So i needed to have this type included to be able to update the project file with these entires without hacking about in the project file each time i needed to add a .ts file. (Which I would add as a .js and then rename it to .ts). I then found an installer for Visual Studio 2013 Update 2 for TypeScript here:

Typescript Installer

Now I recieve an error which means I cannot create the project type anymore, but all the other project types are okay, which to me means that it is related to the TypeScript installation that I just did:

The imported project "C:\Program Files(x86)\MSBuild\Microsoft\VisualStudio\v12.0\Javascript\Microsoft.VisualStudio.Javascript.Common.targets" was not found. Confirm that the path .... etc.

My question is ... How do I resolve this? Or ... How is everyone else using the Cordova API in Visual Studio 2013 Update 2 CTP1.1 without using TypeScript?

Any help will be appreciated, thanks in advance!


回答1:


The project creation issues may be fixed now since there were several new CTP releases of the Cordova tools and they have reached RTM in Visual Studio 2015. It looks like this issue was also solved in the comments (though separate issues came up). I work in the team that builds these Cordova tools and I know that we fixed may installation issues since the CTP 1.1 release, so I'd suggest upgrading.

Also, since it was mentioned in this question - Here's some guidance for using TypeScript files in Visual Studio with Apache Cordova:

https://github.com/Microsoft/cordova-docs/blob/master/getting-started/tutorial-typescript.md



来源:https://stackoverflow.com/questions/24831683/unable-to-create-apache-cordova-project-in-visual-studio-2013

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!