How can I create a Universal Windows Application using TypeScript in Visual Studio 2015?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 10:58:40

问题


Visual Studio 2015 does not have a project template for Universal Windows Applications in TypeScript. I would like to know how to get started.


回答1:


In Visual Studio 2015.1, this works out-of-the-box. In 2015.2 and 2015.3 however, you have to work around a TypeScript installation bug. See second part for a how-to.

With the Universal SDK installed, go to New Project -> JavaScript -> Windows -> Blank App (Universal Windows). Simply change main.js to main.ts and you're set.


If you're running Visual Studio 2015.2 or 2015.3, you need to tweak your TypeScript install first. Shout-out to @minestarks on GitHub:

I assume you're running in an English locale here, otherwise I don't think the workaround is applicable.

Close VS. In an administrator command prompt:

cd %ProgramFiles(x86)%\msbuild\microsoft\visualstudio\v14.0\typescript mkdir en copy *.xaml en copy TypeScript.Tasks.dll en\TypeScript.Tasks.resources.dll

Now open your UWP project again, the TS files should be visible and building when you build your project.



来源:https://stackoverflow.com/questions/37493863/how-can-i-create-a-universal-windows-application-using-typescript-in-visual-stud

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