3

I'm having issues debugging TypeScript in VS2013 Update 3. The breakpoints for the .ts files will not load. The associated .map files are generated and included in the project. I've tried the suggestion on Typescript 1.0 map files do not load and even specifying the location of the .map files explicitly in the TypeScript configuration for the project properties. None of it worked.

This doesn't seem to be a browser issue either as none of various browsers when run load the breakpoints. That rules out this issue on GitHub as well: https://github.com/Microsoft/TypeScript/issues/556

I have the most current version of Web Essentials, so all of the components are up to date.

How do I get TypeScript debugging to work in VS2013?

EDIT: Just to be clear I wish to debug via VSNET regardless of the browser. Meaning I would like to hit the VSNET breakpoints regardless of which ever browser I choose to start the app with (i.e. Chrome, FF, IE, etc.).

Community
  • 1
  • 1
atconway
  • 20,624
  • 30
  • 159
  • 229

2 Answers2

4

Taking into account you said you want to debug it inside VS2013 and not on a browser (which is what I prefer do it in, namely chrome), you need to use Internet Explorer.

You'll do the following

a) Go to IE Internet Options and UNCHECK these two options

enter image description here

b) On the top menu of VS2013 to Set Internet Explorer as the default browser for Debug activity:

enter image description here

enter image description here

c) Put a break-point on the constructor of your Typescript file:

enter image description here

d) Run your web application

enter image description here

e) That's it - your break-point is hit inside VS2013!

enter image description here

If you have any problems let me know, but this should suffice.

Regards

Edson

EdsonF
  • 2,719
  • 3
  • 30
  • 34
  • Well unfortunately it did _not_ work. I followed the directions exactly, but the debug symbols do not load. I'm using a very basic project to test this. Have a look at this picture which shows a hollow breakpoint, and shows the symbols just don't load: http://4.bp.blogspot.com/-WoXRSfKkGSc/VFBFjprOOII/AAAAAAAABwQ/r_p13nXk1UA/s1600/Debug%2BSymbols%2BNot%2BLoading.jpg With time running out you will get the bounty and thanks for the effort, but I still can't debug. Any help you can offer to see this through on whatever I have incorrect is appreciated. – atconway Oct 29 '14 at 01:43
1

Well the issue is quite obvious but I suppose easily overlooked. One cannot debug minified files. The scripts I was trying to debug were all set up to be bundled and minified in the BundleConfig.cs class. I could leave the bundle assignments in the class, but just set it up so that during debug files are not bundled and minified:

#if (!DEBUG)
    BundleTable.EnableOptimizations = true;
#endif

Another option, but one you will have to remember to toggle is to turn off minification all together:

BundleTable.EnableOptimizations = false;

This really should have been step 1 when I set up the app but had forgotten and didn't think to re-check. Now that I have bypassed it, the debugging works perfectly.

atconway
  • 20,624
  • 30
  • 159
  • 229