如何在 Visual Studio 2015 年使用 TypeScript 创建通用 Windows 应用程序?
How can I create a Universal Windows Application using TypeScript in Visual Studio 2015?
Visual Studio 2015 在 TypeScript 中没有通用 Windows 应用程序的项目模板。我想知道如何开始。
在 Visual Studio 2015.1 中,这是开箱即用的。但是,在 2015.2 和 2015.3 中,您必须解决 TypeScript 安装错误。有关操作方法,请参阅第二部分。
安装通用 SDK 后,转到 New Project -> JavaScript -> Windows -> Blank App (Universal Windows)
。只需将 main.js
更改为 main.ts
即可。
如果你是 运行 Visual Studio 2015.2 或 2015.3,你需要先调整你的 TypeScript 安装。向 @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.
Visual Studio 2015 在 TypeScript 中没有通用 Windows 应用程序的项目模板。我想知道如何开始。
在 Visual Studio 2015.1 中,这是开箱即用的。但是,在 2015.2 和 2015.3 中,您必须解决 TypeScript 安装错误。有关操作方法,请参阅第二部分。
安装通用 SDK 后,转到 New Project -> JavaScript -> Windows -> Blank App (Universal Windows)
。只需将 main.js
更改为 main.ts
即可。
如果你是 运行 Visual Studio 2015.2 或 2015.3,你需要先调整你的 TypeScript 安装。向 @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.