打字稿Web窗体 [英] typescript for web forms

查看:175
本文介绍了打字稿Web窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

时的打字稿支持web窗体?

Is typescript supported on web forms?

我有一个现有的asp.net 4.5 Web窗体项目打字稿似乎不能奏效。
我无法创建一个新的文件,但即使我重命名现有的以.TS它似乎并不奏效。没有身材,没有智能感知,一无所有!

I have an existing asp.net 4.5 web forms project where typescript does not seem to be working. I cannot create a new file, but even if I rename an existing to .ts it does not seem to be working. No build, no intellisense, nothing!

推荐答案

找到答案,我的问题:


  1. 我试图找到在添加新项对话框中的Web文件夹打字稿文件,尽管这是在的Visual C#文件夹中.....为什么?

  1. I was trying to find "Typescript file" in Web folder of the "Add New Item" dialog, although it is in the "Visual C#" folder ..... Why?

除非你有创建了一个.ts文项目中的添加新项,对建设行动的文件属性的选项TypeScriptCompile的不可用并它提出了一个例外。在创建第一个文件后,然后你发现这个选项,可以手动将其设置为.TS文件。

Unless you have a .ts file created with "Add New Item" in your project, the option "TypeScriptCompile" on the "Build Action" of the file properties is not available and it raises an exception. After the first file is created, then you find this option and can manually set it to a .ts file.

选项打字稿文件,是不是可以在添加文件选项,除非你有创建了一个.ts文项目中的添加新项您在一个脚本文件夹(如果你的名字不同,你要添加这个文件的文件夹,该选项不会是可用)。当然,你可以添加从添加新项一.TS文件。

The option "Typescript file" is not available in the "Add File" options unless you have a .ts file created with "Add New Item" in your project and you are in a "Scripts" folder (if you name differently the folder where you want to add this file, this option wont be available). Of course you can add a .ts file from "Add New Item".

您不能容易建立由你自己的TS文件,您必须使用新建文件打字稿从菜单中。这是因为: A) 文件 不能是单向code的code页(我试图找出好几个小时的问题)。如果你尝试编译UNI code .TS与TSC文件,没有任何反应!之后,我保存了.TS文件作为希腊(Windows)中 - 在我的病例,一切都很好! B)必须为每个文件设置为正常工作的.csproj的性质是非常复杂的。 (我试图创建一个.ts文从一个.js文件开始,后来改名....然后用.csproj的打)

You cannot easily create a ts file by your own, you must use "New Typescript file" from menu. That is because: A) The code page of the file must not be Unicode (I was trying to figure out that problem for many hours). if you try to compile a unicode .ts file with tsc, nothing happens!! After I saved the .ts file as Greek(Windows) - in my case-, everything worked fine! B) The .csproj properties that must be set for each file to work correctly are quite complex. (I was trying to create a .ts file starting from a .js file and renaming afterwards.... and then playing with .csproj)

这篇关于打字稿Web窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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