Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get rid of [dynamic] JavaScript views in Visual Studio

Since I installed Visual Studio 2010 from scratch about 2 months ago, it behaves slightly different when debugging JavaScript code being run in IE.

  • When I set a breakpoint, it opens a duplicate of the view with the term "[dynamic]" in the header and marks the breakpoint in there.
  • When a JavaScript error happens during execution, it does the same before it marks the line of code that threw the error.
  • This "dynamic" view is editable but edits have no effect - they are not saved to the file.

I find this behavior pretty uncomfortable. Everytime I notice an error in the code during debugging, I happen to fix it in the dynamic view. I hit save. VS does not complain. Next I refresh the page in IE, and - bang - the changes are lost, it loads the untouched old version again.

I haven't been able to find out how I can turn these views off. Before I re-installed Visual Studio it did not do that. It would only create "dynamic" views for script found in inline script tags in HTML files.

like image 307
chiccodoro Avatar asked Dec 05 '12 15:12

chiccodoro


People also ask

How do I disable JavaScript debugging in Visual Studio?

You can go to Tools > Options > Debugging > General > and then in the right part almost like in the middle of the scroll you'll find the option to enable or disable JavaScript debugging.

Can you debug JavaScript in Visual Studio?

You can debug JavaScript and TypeScript code using Visual Studio. You can hit breakpoints, attach the debugger, inspect variables, view the call stack, and use other debugging features.


2 Answers

Try this IE > Internet Options > Settings (under browsing history) > Check for new version of stored pages : Every time I visit the webpage.

This works for me in IE10.

enter image description here

Other option is to open Developer tools and select cache option Always Refresh from Server as show in the image below

enter image description here

like image 124
Dhana Krishnasamy Avatar answered Sep 27 '22 17:09

Dhana Krishnasamy


Try hitting CTRL+F5 on the web page. That did the trick for me.

The problem was that I had opened other IE windows from a previous debugging session, so the dynamic javascript files were still cached.

like image 33
Zain Rizvi Avatar answered Sep 27 '22 19:09

Zain Rizvi