0

I'm trying to add TypeScript to an existing:

  • web-site (not a web-application)
  • web forms (not MVC)
  • Visual Studio 2012

I think, at a fundamental level, the problem is that an ASP.net web-site has no project. This means there is no ability to define "Build options". An ASP.net web-site cannot declare that a *.ts file should have a build action of Compile, since without a project file there are no build actions.

Obviously i'm not going to convert to a web-application (due to the unresolvable disadvantages of a web-applications).

Having said that, how do i add TypeScript to an:

  • ASP.net
  • web-site
  • web-forms
  • Visual Studio 2012

solution?

Bonus Reading

Community
  • 1
  • 1
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219

2 Answers2

0

You can simply add typescript files to the project and manage the compilation externally (outside of visual studio) using something like grunt-ts https://github.com/basarat/grunt-ts (disclaimer : I am one of the authors)

basarat
  • 261,912
  • 58
  • 460
  • 511
0

You can add a *.ts file to the web folder, then run the ts compiler from the command prompt.

Or create a separate web app with just the TS file. Then in the build properties, add a command to copy it to the desired location.

Greg Gum
  • 33,478
  • 39
  • 162
  • 233