如何让 TypeScript 与 Visual Studio 2013 一起工作 [英] How to get TypeScript working with Visual Studio 2013

查看:24
本文介绍了如何让 TypeScript 与 Visual Studio 2013 一起工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了 Visual Studio 的 Typescript 插件,安装了它并重新启动了我的电脑.我还安装了 VS 2013 Express for Web 和 VS 2013 Ultimate Preview,但 TypeScript 不存在.没有文件模板,没有项目模板,什么都没有.

I have downloaded Typescript plugin for Visual Studio, installed it and restarted my PC. I have also installed both VS 2013 Express for Web and VS 2013 Ultimate Preview but TypeScript is just not there. There are no File Templates, No Project Templates, nothing.

让 TypeScript 正确安装/显示在 Visual Studio 中的各种方法是什么?我尝试了很多不同的事情,比如寻找 vsix 文件并打开它(但该文件在这个版本的 TypeScript 中不存在 - 除非他们将它移到其他地方),我试过下载并安装 Web Essentials - 但他们的网站说他们不再支持 TypeScript,因为显然 VS 现在原生支持它.我也卸载/重新安装了 TypeScript - 很多次.

What are the various ways you have got TypeScript to install properly/show up in Visual Studio? I have tried many different things like looking for the vsix file and opening it (but that file does not exist in this version of TypeScript - unless they've moved it somewhere else), I've tried downloading and installing Web Essentials - but their website says that they no longer support TypeScript because apparently VS supports it natively now. I've also uninstalling/reinstalling TypeScript - many times.

我什至尝试下载旧版本的 TypeScript 0.8.3,但我找到的每个链接都将我重定向到 0.9.1 的新下载页面.

I've even tried downloading the old version of TypeScript 0.8.3 but every single link I've found just redirects me to the new download page for 0.9.1.

没有任何效果.

如何让 TypeScript 与 VS 2013 Express for Web VS 2013 Ultimate Preview 一起使用?

How do I get TypeScript working with either VS 2013 Express for Web or VS 2013 Ultimate Preview?

我在网上看到论坛帖子和评论,人们说这对他们有用.我不知道发生了什么.

I've seen forum posts and comments all over the web where people say that it's working for them. I have no idea what'd going on.

推荐答案

我在这里找到了一个几乎有效的答案.但是在改变了一些东西之后,我能够让它工作.这些步骤与原始步骤略有不同,可在此处找到.

I found a question on here with an answer that almost worked. But after changing some things around I was able to get this working. These steps slightly deviate from the original, which can be found here.

  1. 关闭 Visual Studio.
  2. 安装 Visual C++ Redistributable for Visual Studio 2012 Update 3 x86 版本(即使在 x64 平台上运行;tsc.exe 是 x86 应用程序).
  3. 下载 Visual Studio 2012 版本 0.9.0.1 的 TypeScript
  4. 使用 https 将 MSI 文件解压缩/解压缩到一个临时位置://code.google.com/p/lessmsi/
  5. 复制目录SourceDirMicrosoft SDKsTypeScript%ProgramFiles(x86)%Microsoft SDKs
  6. 复制目录SourceDirVS11_EXTENSIONS_DIRTypeScript%ProgramFiles(x86)%Microsoft Visual Studio 12.0Common7IDEExtensionsMicrosoft
  7. 复制SourceDirVS11文件夹中的两个文件(file.tsnewtypescriptfileitems.vsdir)到 %ProgramFiles(x86)%\Microsoft Visual Studio 12.0Common7IDENewFileItems
  8. 将文件夹 SourceDirMSBuildMicrosoftVisualStudiov12.0TypeScript 复制到%ProgramFiles(x86)%MSBuildMicrosoftVisualStudiov12.0
  9. 修改您的路径环境变量以包含 %ProgramFiles(x86)%Microsoft SDKsTypeScript
  10. 启动视觉工作室.
  1. Close Visual Studio.
  2. Install Visual C++ Redistributable for Visual Studio 2012 Update 3 x86 version (even if running on an x64 platform; tsc.exe is an x86 application).
  3. Download TypeScript for Visual Studio 2012 version 0.9.0.1
  4. Uncompress/Extract the MSI file to a temporary location using https://code.google.com/p/lessmsi/
  5. Copy the directory SourceDirMicrosoft SDKsTypeScript to %ProgramFiles(x86)%Microsoft SDKs
  6. Copy the directory SourceDirVS11_EXTENSIONS_DIRTypeScript to %ProgramFiles(x86)%Microsoft Visual Studio 12.0Common7IDEExtensionsMicrosoft
  7. Copy the the two files in the SourceDirVS11 folder (file.ts, newtypescriptfileitems.vsdir) to %ProgramFiles(x86)%\Microsoft Visual Studio 12.0Common7IDENewFileItems
  8. Copy the folder SourceDirMSBuildMicrosoftVisualStudiov12.0TypeScript to %ProgramFiles(x86)%MSBuildMicrosoftVisualStudiov12.0
  9. Modify your path environment variable to include %ProgramFiles(x86)%Microsoft SDKsTypeScript
  10. Start visual studio.

这些确切的步骤使我能够在 Visual Studio 2013 Preview 和 Visual Studio 2013 Express for Web 中使用完整的 TypeScript 支持.非常感谢发布此答案的家伙.

These exact steps led to me being able to work with full TypeScript support in Visual Studio 2013 Preview and Visual Studio 2013 Express for Web. A big thanks goes to the dude who posted this answer.

这篇关于如何让 TypeScript 与 Visual Studio 2013 一起工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆