Using TypeScript 1.0 in web site project (WSP) without project file?

Topics: General
May 1, 2014 at 5:45 PM
I am trying to get TypeScript to work on a web site project in VS2013 Update 2RC. The web site is the older web site project (WSP) format that does not have a project file but instead just automatically includes all files in the folder structure. I do not get the "TypeScript File" option when I select "Add" in VS. I manually added a .ts file but VS is not auto compiling to .js. I was able to manually run "tsc" from the command line to compile but would like to the auto integration working. Is this possible in a WSP? I see instructions for entries to add to the project file but the web site doesn't have a project file. Can the entries be added to the solution file instead?
May 15, 2014 at 3:01 PM
same problem, with new web site or web application project :(
May 17, 2014 at 12:36 AM
The TypeScript language service needs a project file to load all files in the project. The reason is to ensure that the language service experience matches the results of the build process. For websites a project file is obviously not present, and thus we can not tell how these files will be built at build time, and we do not have a way of knowing. You can inform the language service about the files in your compilation unit by using /// references. A simple approach is to have an index.ts that has references to all your files, and all your files have a reference to it. this way when you open any .ts file in your project the language service can follow your /// references and find all other files in the project. your can also use the index.ts in your build script, and the compiler will walk the references at build time.
Aug 1, 2014 at 1:01 AM
I can create a typescript project just fine if I make it a project. But I have an existing web site in IIS (and I then mirror it on a server). I tried adding typescript and it created a solution and project file under "documents" (which is not ideal) but still offers me support for .ts files (no Typescript in Add New Item). Also I want to understand how to do both server side and client side Typescript in the same project. I already have default.aspx.cs

I can explore it myself if there were a few hints as to the preferred approach -- starting with "I open an IIS application without a *proj file in Visual Studio 2013" and then .....