How to setup TypeScript environment in Visual Studio 2015

I am using the community edition Visual Studio 2015. I want to setup the environment to use TypeScript to be used in an asp.net webforms application. I see lots of guidance in doing it using Visual Studio Code but not in Visual Studio. I was following the methods given at http://mobilemancer.com/2015/08/14/getting-started-typescript-1-5-in-visual-studio-2015/ However I don’t see the option for NPM Configuration file under DNX. I see it only under C#, so probably it is server side while DNX represents client side. I have installed Visual Studio 2015 Update 3 as well as .Net Core 1.0

Thanks

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

It’s actually pretty straight forward:

  1. Install TypeScript from Tools -> Extension and Updates
  2. Add tsconfig.json at the root of the web form project. Refer to this link for more info on the TypeScript configuration file.
  3. Add TypeScript file (*.ts) to your application
  4. Add link to the transpiled JavaScript file in your page. You can define where the JavaScript file is created in the tsconfig.json file.

If you need to use NPM, then your original reference link works just fine.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply