<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Steve Sheppard's Blog : Tips</title><link>http://blogs.msdn.com/steveshe/archive/tags/Tips/default.aspx</link><description>Tags: Tips</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>The Challenges of Script Debugging Using VS2008</title><link>http://blogs.msdn.com/steveshe/archive/2009/03/18/the-challenges-of-script-debugging-using-vs2008.aspx</link><pubDate>Thu, 19 Mar 2009 00:02:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9488039</guid><dc:creator>steveshe</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/steveshe/comments/9488039.aspx</comments><wfw:commentRss>http://blogs.msdn.com/steveshe/commentrss.aspx?PostID=9488039</wfw:commentRss><description>&lt;p&gt;I recently worked on a problem that required me to debug the script for the HTML Editor control ion WSS. In the past I have always used the Microsoft Script Debugger and just selected "Break on next statement". In this case that was not really getting me where I needed to be so I decided to try to do it with VS2008. &lt;/p&gt; &lt;p&gt;Unfortunately this presented a new set of problems because while I knew&amp;nbsp; where the code was I wanted to debug I still didn't have a good way to catch it when it executed. A quick bit of web searching turned up this &lt;a href="http://www.beansoftware.com/ASP.NET-Tutorials/Client-Script-Debugging.aspx"&gt;blog post&lt;/a&gt; that briefly mentioned the "debugger;" instruction. Not being a JavaScript guy I was unaware of this command. It's simply invokes the debugger when it executes. How very handy :)&lt;/p&gt; &lt;p&gt;I then edited my .js file in the \Layouts\1033 folder and added the line "debugger;" at the beginning of the function I wanted to work on. I then cleared the IE temporary internet files folder so I would easily get the new version of the .js file. I went through the steps to reproduce the problem and it opened Windows Script Debugger. This was not what I wanted. I wanted Visual Studio 2008 so I could use all the fancy features like hovering over variables and such. &lt;/p&gt; &lt;p&gt;I speculated that the problem might be that when I installed the script debugger it stole the JIT settings from VS2008 so I uninstalled it and tried again. No joy. OK, it may have stolen them and not put them back when it was removed. &lt;/p&gt; &lt;p&gt;It occurred to me that it may be that VS2008 is just not configured for JIT debugging of scripts. I checked my VS2008 debugging setting in the UI and found that I didn't have the Script setting enabled so I turned off the other two and enabled it:&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/steveshe/WindowsLiveWriter/TestpostfromLiveWriter_CDFB/image_4.png" target="_blank"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="374" alt="image" src="http://blogs.msdn.com/blogfiles/steveshe/WindowsLiveWriter/TestpostfromLiveWriter_CDFB/image_thumb_1.png" width="644" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;A quick test verified that this did not fix my problem.&lt;/p&gt; &lt;p&gt;At this point one of my EE cronies (Rob Anderson) mentioned that he gets the JIT debugger popup when he does script debugging, I don't. This reminds me that historically the &lt;a href="http://msdn.microsoft.com/en-us/library/5hs4b7a6(VS.80).aspx"&gt;AEDebug&lt;/a&gt; key controlled this behavior. We check his registry settings and compare them to mine and discover that the likely reason is that I am missing the "Auto" key and value. Adding that fixed my problem and I am now happily JIT debugging javascript in Visual Studio 2008!&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Here is the proper settings for this to work on an x86 machine:&lt;/p&gt; &lt;p&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug&lt;br&gt;&lt;strong&gt;"Auto"="1"&lt;br&gt;&lt;/strong&gt;"Debugger"="\"D:\\WINDOWS\\system32\\vsjitdebugger.exe\" -p %ld -e %ld"&lt;br&gt;"UserDebuggerHotKey"=dword:00000000  &lt;p&gt;In my case these settings needed to be transposed to the x64 registry location:  &lt;p&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug&amp;nbsp; &lt;p&gt;Other than the location, the setting are the same.  &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9488039" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/steveshe/archive/tags/Tips/default.aspx">Tips</category></item></channel></rss>