<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/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>Glavs Blog : debugging</title><link>http://weblogs.asp.net/pglavich/archive/tags/debugging/default.aspx</link><description>Tags: debugging</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>iPhone Apps using Microsoft .NET</title><link>http://weblogs.asp.net/pglavich/archive/2009/12/02/iphone-apps-using-microsoft-net.aspx</link><pubDate>Tue, 01 Dec 2009 22:22:09 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7268159</guid><dc:creator>Glav</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pglavich/rsscomments.aspx?PostID=7268159</wfw:commentRss><comments>http://weblogs.asp.net/pglavich/archive/2009/12/02/iphone-apps-using-microsoft-net.aspx#comments</comments><description>&lt;p&gt;My good friend &lt;a href="http://weblogs.asp.net/wallym/"&gt;Wally McClure&lt;/a&gt; has written a short eBook on “&lt;strong&gt;Building iPhone and iPod touch Applications for the .NET/C# Developer with MonoTouch&lt;/strong&gt;”.&lt;/p&gt;  &lt;p&gt;You can check it out &lt;a href="http://www.wrox.com/WileyCDA/WroxTitle/Building-iPhone-and-iPod-touch-Applications-for-the-NET-C-Developer-with-MonoTouch.productCd-0470590734.html"&gt;here&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Given that iPhone is a very popular phone and that some of the development barrier for Microsofties like me is no .Net language support (Objective-C being the native development language), this can now be overcome with the help of Wally’s eBook.&lt;/p&gt;  &lt;p&gt;Its small and concise with topics covering class library support, deployment and debugging. I encourage you to check it out.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7268159" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pglavich/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/debugging/default.aspx">debugging</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/General/default.aspx">General</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/Mobile/default.aspx">Mobile</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/iPhone/default.aspx">iPhone</category></item><item><title>Regaining results from a performance test run</title><link>http://weblogs.asp.net/pglavich/archive/2009/04/29/regaining-results-from-a-performance-test-run.aspx</link><pubDate>Wed, 29 Apr 2009 12:48:33 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7064546</guid><dc:creator>Glav</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pglavich/rsscomments.aspx?PostID=7064546</wfw:commentRss><comments>http://weblogs.asp.net/pglavich/archive/2009/04/29/regaining-results-from-a-performance-test-run.aspx#comments</comments><description>&lt;p&gt;I have been doing a lot of performance testing lately, and one of the worst things that can happen during a performance run, is when you don’t get any results. Performance testing is expensive, from a time and resources perspective, so getting results from a run is paramount.&lt;/p&gt;  &lt;p&gt;In my scenario, I have everything automated to kick off a performance run, at 7.00pm every night, run for 12 hours, then terminate. I collect metrics via Visual Studio Team Suite which is used to drive my performance tests, but I also have automated the collection of performance metrics on all related servers (web, sql etc…)&lt;/p&gt;  &lt;p&gt;On one of my recent runs, I came into the office in the morning, and checked on the test rig. The test appeared to be still running, even well beyond the termination time. VSTS reported that it was trying to abort the test, but things were still running. Some of the test agents refused to respond.&lt;/p&gt;  &lt;p&gt;I pressed the stop button to stop the test in VSTS and while I was waiting for that, loaded up the test results so far. The business were eagerly awaiting the results of the tests and it looked promising so far.&lt;/p&gt;  &lt;p&gt;Visual Studio began to refuse to respond after a while and was continuing to try and stop the test. After a long wait, I simply killed off the &lt;font size="2" face="Courier New"&gt;devenv.exe&lt;/font&gt; process, and restarted the Visual Studio Test controller service.&lt;/p&gt;  &lt;p&gt;I then went to load my test data from the run. Oh dear, the test run that I was looking at not more than half an hour ago, did not appear. Nothing listed on the ‘Completed Tests’ tab, and nothing within the ‘Manage Test Results’ option either.&lt;/p&gt;  &lt;p&gt;Crap. A business person walks by and asks how the test run went. “Still analysing the data” was my response. Double crap. What to do.&lt;/p&gt;  &lt;p&gt;After looking at the SQL database where the load results are stored, it was apparent there was a bunch of data in there, that simply was not showing. Looking through the raw data did not appeal to me very much.&lt;/p&gt;  &lt;p&gt;I had a look in the&lt;font size="2" face="Courier New"&gt; ‘LoadTest’&lt;/font&gt; table in the LoadTest database I was using to see if there was any data.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pglavich/image_4D1C360B.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pglavich/image_thumb_6ED7E8CF.png" width="299" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I noticed there was no ‘&lt;font size="2" face="Courier New"&gt;End Time&lt;/font&gt;’ defined for my run. It was simply set to NULL&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pglavich/image_5E9BFB09.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pglavich/image_thumb_757ACC85.png" width="566" height="250" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;. The Start Date was correct, so I simply copied the &lt;font size="2" face="Courier New"&gt;StartTime&lt;/font&gt; to the &lt;font size="2" face="Courier New"&gt;EndTime&lt;/font&gt; column, changed the date to the next day, and set the time to AM instead of PM (thus setting my 12 hour run).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/pglavich/image_79387155.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/pglavich/image_thumb_492E1FD4.png" width="558" height="214" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;And now I have normal access to all my test results. Whew…. crisis averted.&lt;/p&gt;  &lt;p&gt;Hope this helps someone.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7064546" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pglavich/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/debugging/default.aspx">debugging</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/General/default.aspx">General</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/Performance/default.aspx">Performance</category></item><item><title>Debugging Silverlight apps using WinDbg</title><link>http://weblogs.asp.net/pglavich/archive/2008/12/03/debugging-silverlight-apps-using-windbg.aspx</link><pubDate>Wed, 03 Dec 2008 00:29:12 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6763291</guid><dc:creator>Glav</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pglavich/rsscomments.aspx?PostID=6763291</wfw:commentRss><comments>http://weblogs.asp.net/pglavich/archive/2008/12/03/debugging-silverlight-apps-using-windbg.aspx#comments</comments><description>&lt;p&gt;While working on a silverlight application for my current engagement, we were seeing some weird memory issues and application crashes. I won't bore you with the initial investigation of the issue, but it turns out we need to delve deep into what was going on behind the scenes. A fellow colleague and friend, &lt;a target="_blank" href="http://miguelmadero.blogspot.com/"&gt;Miguel Madero&lt;/a&gt;, was also encountering similar issues. He also did some work in debugging the issues he was seeing,&amp;nbsp; and because they were similar to mine, I had a little headstart in where to look. Note: I know that &lt;a target="_blank" href="http://miguelmadero.blogspot.com/"&gt;Miguel&lt;/a&gt; will also be publishing some debugging tips around Silverlight and he is a Silverlight gun so keep an eye on his &lt;a target="_blank" href="http://miguelmadero.blogspot.com/"&gt;blog&lt;/a&gt; for more details.&lt;/p&gt; &lt;p&gt;At any rate, our silverlight apps, after opening certain pages many times (&amp;gt; 8), the application would crash. No real information why, and the Visual Studio debugger wasn't helping a lot as the exception it was faulting on was just the final exception when things got too much.&lt;/p&gt; &lt;p&gt;In Visual Studio, turning on Catch all first chance exceptions wasn't helping either as there were too many other first chance exceptions that were confusing things (and yes, many framework related ones).&lt;/p&gt; &lt;p&gt;So, using &lt;a target="_blank" href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx"&gt;WinDbg&lt;/a&gt;, we decided to dig deeper. The rest of this post shows how we debugged some silverlight issues using &lt;a target="_blank" href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx"&gt;WinDbg&lt;/a&gt; using some general examples, and a few specific ones.&lt;/p&gt; &lt;p&gt;&lt;u&gt;Getting Started.&lt;/u&gt;&lt;/p&gt; &lt;p&gt;You can create crash dumps to examine using a tool like &lt;a target="_blank" href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx"&gt;adplus&lt;/a&gt; (&lt;a target="_blank" href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx"&gt;part of the debugging tools&lt;/a&gt;) which I did, but I also prefer to attach to the running process itself where possible so I shall use that here.&lt;/p&gt; &lt;p&gt;1. Loaded up WinDbg&lt;/p&gt; &lt;p&gt;2. Loaded the SOS module for silverlight which is the managed debugging extension.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_thumb.png" width="519" height="213"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;3. Set the symbol path to a local directory on my system as well as the microsoft symbol servers when the tool needs to download/resolve symbols.&lt;/p&gt; &lt;p&gt;You can do this via the command line&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_3.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_thumb_3.png" width="497" height="76"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;or via the user interface&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_4.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_thumb_4.png" width="494" height="310"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;4. Fire up your SIlverlight application in a standard Internet Explorer browser window. Do not invoke debugging within Visual Studio (ie. press the 'Play' button or hit 'F5' to start the app) as this will attach its own debugger. Then attach WinDbg to the 'iexplore.exe' process.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_5.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_thumb_5.png" width="334" height="166"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_6.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_thumb_6.png" width="258" height="374"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;5. Now we are ready to begin actual debugging. Typing 'g' into the command line gets the debugee running, and WinDbg monitors the application for first chance exceptions.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_7.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_thumb_7.png" width="475" height="143"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;One thing that is not so apparent within Silverlight, particularly when using the MVVM (Model-View-ViewModel) pattern which typically uses DataBinding extensively, is when data binding errors occur. The framework tends to hide these little gems away, and sometimes, it just appears like its not working. Note that these will also appear in the Visual Studio debug output window but I find it actually easier to have the WinDbg window running side by side with the browser to watch all exceptions as they occur.&lt;/p&gt; &lt;p&gt;By way of example, lets imagine the view model has this property, SelectedThing.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_8.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_thumb_8.png" width="453" height="258"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Now lets also imagine we have a ComboBox databound to this using the following XAML.&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;lt;ComboBox x:Name="DropList" Grid.Row="1" Height="30"&amp;nbsp; &lt;font color="#0000ff"&gt;ItemsSource="{Binding SomeData}"&lt;/font&gt; DisplayMemberPath="Name" &lt;font color="#0000ff"&gt;SelectedIndex="{Binding SelectedThing, Mode=TwoWay}"&lt;/font&gt; /&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Finally, when we fill up/gather our data, we set the SelectedThing to an initial value:&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Courier New"&gt;SelectedThing = SomeData[0];&lt;/font&gt;&lt;/p&gt; &lt;p&gt;The astute among you can probably already see where the error is, but lets persist for the sake of example. We load the app and see that the ComboBox is not having its selected item bound to anything.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_9.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_thumb_9.png" width="430" height="274"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;At this stage, no errors are prevalent, other than we have no SelectedItem in the ComboBox. Hpwever, looking at the WinDbg window, shows us that there were some exceptions occurring.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_10.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.theglavs.com/article_Images/SilverlightViewModelsandObservableCollec_10021/image_thumb_10.png" width="476" height="83"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Specifically, we can see that an exception occurred with a BindingExpression, in which a converter failed to convert a value for 'SomeItem'. The entire message is shown below, and its pretty verbose about what failed.&lt;/p&gt; &lt;p&gt;(Again, this is the same output as the Visual Studio debug output window)&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Courier New"&gt;System.Windows.Data Error: 'MS.Internal.Data.DynamicValueConverter' converter failed to convert value 'TestSLCrap.SomeItem' (type 'TestSLCrap.SomeItem'); BindingExpression: Path='SelectedThing' DataItem='TestSLCrap.ViewModel' (HashCode=64479624); target element is 'System.Windows.Controls.ComboBox' (Name='DropList'); target property is 'SelectedIndex' (type 'System.Int32').. System.InvalidOperationException: Can't convert type TestSLCrap.SomeItem to type System.Int32.&lt;br&gt;&amp;nbsp;&amp;nbsp; at MS.Internal.Data.DefaultValueConverter.Create(Type sourceType, Type targetType, Boolean targetToSource)&lt;br&gt;&amp;nbsp;&amp;nbsp; at MS.Internal.Data.DynamicValueConverter.EnsureConverter(Type sourceType, Type targetType)&lt;br&gt;&amp;nbsp;&amp;nbsp; at MS.Internal.Data.DynamicValueConverter.Convert(Object value, Type targetType, Object parameter, CultureInfo culture)&lt;br&gt;&amp;nbsp;&amp;nbsp; at System.Windows.Data.BindingExpression.ConvertToTarget(Object value).&lt;/font&gt;  &lt;p&gt;It tells us the value to convert, the binding path and the property. Pretty easy to fix. In the XAML we simply change this:&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Courier New"&gt;SelectedIndex="{Binding SelectedThing, Mode=TwoWay}"&lt;/font&gt;&lt;/p&gt; &lt;p&gt;to this:&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Courier New"&gt;SelectedItem="{Binding SelectedThing, Mode=TwoWay}"&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Again, pretty simple and actually an easy error to do if you are going fast and accepting the Intellisense suggested property without really looking. To bring this back to my problematic silverlight app I mentioned, while debugging I found numerous instances of binding issues where properties were NULL when not expected and a few others. Eliminating these certainly made the app run better but it was still crashing.&lt;/p&gt; &lt;p&gt;So, I gotta dig deeper. I had a look at some of the exceptions on the heap.&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Courier New"&gt;0:005&amp;gt; !dumpheap -type Exception&lt;br&gt;Address MT Size&lt;br&gt;03a21024 038c72d0 72&lt;br&gt;03a2106c 038c7398 72&lt;br&gt;03a210b4 038c7458 72&lt;br&gt;03a210fc 038c750c 72&lt;br&gt;03a21144 038c750c 72&lt;br&gt;03a24edc 060a5668 32&lt;br&gt;03a25a4c 060d51e4 32&lt;br&gt;03a25a6c 060d52c0 32&lt;br&gt;03a2dac4 060dd240 32&lt;br&gt;03a3d254 0321f48c 12&lt;br&gt;03a3d26c 0321f510 12&lt;br&gt;total 11 objects&lt;br&gt;Statistics:&lt;br&gt;MT Count TotalSize Class Name &lt;br&gt;0321f510 1 12 System.Text.DecoderExceptionFallback&lt;br&gt;0321f48c 1 12 System.Text.EncoderExceptionFallback&lt;br&gt;060dd240 1 32 System.EventHandler`1[[System.Windows.ApplicationUnhandledExceptionEventArgs, System.Windows]]&lt;br&gt;060d52c0 1 32 MS.Internal.Error+GetExceptionTextDelegate&lt;br&gt;060d51e4 1 32 MS.Internal.Error+ClearExceptionDelegate&lt;br&gt;060a5668 1 32 System.UnhandledExceptionEventHandler&lt;br&gt;038c7458 1 72 System.ExecutionEngineException&lt;br&gt;038c7398 1 72 System.StackOverflowException&lt;br&gt;038c72d0 1 72 System.OutOfMemoryException&lt;br&gt;038c750c 2 144 System.Threading.ThreadAbortException&lt;br&gt;Total 11 objects&lt;br&gt;&lt;/font&gt; &lt;p&gt;Hmmm, not too much interesting here as these exceptions. Lets dump the current stack objects to see what that yields:&lt;/p&gt;&lt;pre&gt;0:005&amp;gt; !dso
OS Thread Id: 0xa54 (5)
ESP/REG  Object   Name
0179E85C 04084278 Views.DataDisplayView
0179E880 03a82684 System.Windows.CoreDependencyProperty
0179E884 04084278 Views.DataDisplayView
0179E89C 04084278 Views.DataDisplayView
0179E8BC 03a82684 System.Windows.CoreDependencyProperty
0179E8C0 04084278 Views.DataDisplayView
0179E8CC 0450f6d8 System.Windows.Controls.RadioButton
0179E8E0 03a82684 System.Windows.CoreDependencyProperty
0179E8E4 04084278 Views.DataDisplayView
0179E8F0 03a82684 System.Windows.CoreDependencyProperty
0179E8F4 04084278 Views.DataDisplayView
0179E904 04084278 Views.DataDisplayView
0179E910 04084278 Views.DataDisplayView
0179E914 04084278 Views.DataDisplayView
0179E918 04084278 Views.DataDisplayView
0179E91C 04088ca0 System.Windows.Controls.RadioButton
0179E938 04088ca0 System.Windows.Controls.RadioButton

. . . majority of listing omitted for brevity

0179E980 0450f6d8 System.Windows.Controls.RadioButton
0179E990 0455641c System.Windows.RoutedEventArgs
0179E994 0450f6d8 System.Windows.Controls.RadioButton
0179F7C4 03a6f9d0 Ninject.Core.Injection.DynamicMethodInjector
0179F7C8 0425fcd8 System.Object[]    (System.Object[])
179F9BC 03a92720 PresentationLayer.UI.UserControls.MenuItem
0179F9E4 03a92c00 System.Windows.Input.MouseButtonEventHandler
0179FA04 03a92720 PresentationLayer.UI.UserControls.MenuItem
0179FA08 0425f898 System.Windows.Input.MouseButtonEventArgs
0179FA44 0425f87c System.String    M@21
0179FB24 03a2526c MS.Internal.FrameworkCallbacks+FireEventDelegate
0179FBC8 03a2526c MS.Internal.FrameworkCallbacks+FireEventDelegate
&lt;/pre&gt;
&lt;p&gt;Now this is much more interesting, as you can see multiple references to Views.DataDisplayView where only 1, should be present. I poked around the objects themselves and found similar patterns. Using the '&lt;em&gt;gcroot&lt;/em&gt;' command, I could see what objects were 'hanging around'.&lt;/p&gt;&lt;pre&gt;0:005&amp;gt; !gcroot 04084278
Note: Roots found on stacks may be false positives. Run "!help gcroot" for
more info.
Scan Thread 5 OSTHread a54
ESP:179e85c:Root:  04084278(Views.DataDisplayView)-&amp;gt;
ESP:179e884:Root:  04084278(Views.DataDisplayView)-&amp;gt;
ESP:179e89c:Root:  04084278(Views.DataDisplayView)-&amp;gt;
ESP:179e8c0:Root:  04084278(Views.DataDisplayView)-&amp;gt;
ESP:179e8e4:Root:  04084278(Views.DataDisplayView)-&amp;gt;
ESP:179e8f4:Root:  04084278(Views.DataDisplayView)-&amp;gt;
ESP:179e904:Root:  04084278(Views.DataDisplayView)-&amp;gt;
ESP:179e910:Root:  04084278(Views.DataDisplayView)-&amp;gt;
ESP:179e914:Root:  04084278(Views.DataDisplayView)-&amp;gt;
ESP:179e918:Root:  04084278(Views.DataDisplayView)-&amp;gt;
ESP:179e91c:Root:  04088ca0(System.Windows.Controls.RadioButton)-&amp;gt;
  0408900c(System.Windows.DataContextChangedEventHandler)-&amp;gt;
  04088fd0(System.Windows.Data.BindingExpression)-&amp;gt;
  04076c74(Views.DataDisplayViewViewModel)-&amp;gt;
  04076eb8(System.Collections.ObjectModel.ObservableCollection`1[[MyApp.DataEntities.WeekCommence,  
MyApp.DataEntities]])-&amp;gt;
  0409dbb0(System.Collections.Specialized.NotifyCollectionChangedEventHandler)-&amp;gt;
  04085a34(System.Windows.Controls.ComboBox)-&amp;gt;
  04085c84(System.Windows.Controls.SelectionChangedEventHandler)-&amp;gt;
  04084278(Views.DataDisplayView)-&amp;gt;
ESP:179e938:Root:  04088ca0(System.Windows.Controls.RadioButton)-&amp;gt;
  0408900c(System.Windows.DataContextChangedEventHandler)-&amp;gt;
  04088fd0(System.Windows.Data.BindingExpression)-&amp;gt;
  04076c74(Views.DataDisplayViewViewModel)-&amp;gt;
  04076eb8(System.Collections.ObjectModel.ObservableCollection`1[[MyApp.DataEntities.WeekCommence,  
MyApp.DataEntities]])-&amp;gt;
  0409dbb0(System.Collections.Specialized.NotifyCollectionChangedEventHandler)-&amp;gt;
  04085a34(System.Windows.Controls.ComboBox)-&amp;gt;
  04085c84(System.Windows.Controls.SelectionChangedEventHandler)-&amp;gt;
  04084278(Views.DataDisplayView)-&amp;gt;
Scan Thread 13 OSTHread 16b4
Scan Thread 14 OSTHread 1274
Scan Thread 15 OSTHread 15a8
Scan Thread 16 OSTHread 1330

&lt;/pre&gt;
&lt;p&gt;I could see many instances of references to properties of type ObservableCollection&amp;lt;&amp;gt;. Looking at the pinned/rooted objects for a view other instances of the 'Views.DataDisplayView' objects, revealed similar results, some showing many instances of references to properties that implemented ObservableCollection&amp;lt;&amp;gt;.&lt;/p&gt;
&lt;p&gt;Obviously, something was subscribing to the collection changed events of the ObservableCollections, and simply not letting go. Whether this be the DataBinding infrastructure of Silverlight or a result of some of the dodgy code in the application, its currently hard to say as the code is quite convoluted.&lt;/p&gt;
&lt;p&gt;I can say this however. Changing the properties listed in the WinDbg sessions from ObservableCollections to simple generic List&amp;lt;&amp;gt; types completely solved my crashing issue. Simply changing these types involved a bit of work to now manually raise the appropriate property changed events when these properties are changed, but at least my application doesn't crash.&lt;/p&gt;
&lt;p&gt;As a result, I now keep WinDbg loaded during most of my silverlight development, with the symbol path and symbols loaded and ready to go. its easy to just attach to the iexplore.exe process, make sure its all good, and be on my way. I know that WinDbg can save all this workspace information, but for some reason, sometimes it doesn't so I generally keep it loaded and its small enough anyway.&lt;/p&gt;
&lt;p&gt;Hope this proves informative for someone.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6763291" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pglavich/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/debugging/default.aspx">debugging</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Profiling your AJAX Applications using AjaxView</title><link>http://weblogs.asp.net/pglavich/archive/2008/06/03/profiling-your-ajax-applications-using-ajaxview.aspx</link><pubDate>Tue, 03 Jun 2008 05:35:09 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6243959</guid><dc:creator>Glav</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pglavich/rsscomments.aspx?PostID=6243959</wfw:commentRss><comments>http://weblogs.asp.net/pglavich/archive/2008/06/03/profiling-your-ajax-applications-using-ajaxview.aspx#comments</comments><description>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Don't know if this has already been discussed at length before, but I found an interesting little tool from Microsoft Research for profiling the Javascript functionality in your AJAX applications.&lt;/p&gt; &lt;p&gt;Its called &lt;a href="http://research.microsoft.com/projects/ajaxview/" target="_blank"&gt;AjaxView&lt;/a&gt; and can remotely monitor any AJAX web app that is currently on the web, locally or whatever.&lt;/p&gt; &lt;p&gt;You basically, install a small proxy application, then change your Internet Explorer LAN connection to go through a proxy of &lt;font size="2" face="Courier New"&gt;localhost:8888.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Go and browse your web application or your own AJAX app, and execute your normal series of functionality.&lt;/p&gt; &lt;p&gt;Once your done, you then browse to a page generated by the tool itself&lt;/p&gt; &lt;p&gt;&lt;a href="http://fakeurl.com/?&amp;amp;AJAXVIEWREQUEST=GET=main.html"&gt;http://fakeurl.com/?&amp;amp;AJAXVIEWREQUEST=GET=main.html&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This gets you something like this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/ProfilingyourAJAXApplicationsusingAjaxVi_C482/clip_image002.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="clip_image002" src="http://www.theglavs.com/article_Images/ProfilingyourAJAXApplicationsusingAjaxVi_C482/clip_image002_thumb.jpg" width="553" height="379"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;You can then click on whatever item you want, typically the site that represents the worst performance. You'll then get something like this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/ProfilingyourAJAXApplicationsusingAjaxVi_C482/clip_image00210.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="clip_image002[10]" src="http://www.theglavs.com/article_Images/ProfilingyourAJAXApplicationsusingAjaxVi_C482/clip_image00210_thumb.jpg" width="644" height="320"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Here I have clicked on the 'Mean Time (ms)' view to get column sorted by the slowest functions. If I want to drill down a bit more, I can click on the 'Details' link which gives me:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/ProfilingyourAJAXApplicationsusingAjaxVi_C482/clip_image00212.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="clip_image002[12]" src="http://www.theglavs.com/article_Images/ProfilingyourAJAXApplicationsusingAjaxVi_C482/clip_image00212_thumb.jpg" width="644" height="384"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This shows me a breakdown of which functions took how long.&lt;/p&gt; &lt;p&gt;Its actually a pretty quick way to get a good idea of what is consuming a lot of client side cycles from a Javascript perspective. The tool is a little raw and is still somewhat rough, but its easy enough to use and get going and worth a quick look.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6243959" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pglavich/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/debugging/default.aspx">debugging</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/Web+2.0/default.aspx">Web 2.0</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/Performance/default.aspx">Performance</category></item><item><title>Dodgy Debugging</title><link>http://weblogs.asp.net/pglavich/archive/2007/10/11/dodgy-debugging.aspx</link><pubDate>Thu, 11 Oct 2007 05:45:52 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:4521010</guid><dc:creator>Glav</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pglavich/rsscomments.aspx?PostID=4521010</wfw:commentRss><comments>http://weblogs.asp.net/pglavich/archive/2007/10/11/dodgy-debugging.aspx#comments</comments><description>&lt;p&gt;In a &lt;a href="http://weblogs.asp.net/pglavich/archive/2007/09/09/obscure-asp-net-problem-ajax-control-toolkit-collapsiblepanelextender-image-controls-pages-loading-more-than-once.aspx"&gt;previous post&lt;/a&gt;, I mentioned an obscure ASP.NET issue that had me scratching my head for a while.&lt;/p&gt; &lt;p&gt;In order to track it down, I had to resort some dodgy debugging techniques which I wouldn't call exactly scientific nor particularly complex, but they did help, so thought I'd share.&lt;/p&gt; &lt;p&gt;Basically, the page had many controls, and nested controls within many other containers and the like. The problem was difficult because there was no actual errors being caused and no obvious culprit to the "double request" problem I mentioned in the &lt;a href="http://weblogs.asp.net/pglavich/archive/2007/09/09/obscure-asp-net-problem-ajax-control-toolkit-collapsiblepanelextender-image-controls-pages-loading-more-than-once.aspx"&gt;previous post&lt;/a&gt;, so I had to start eliminating sections of the page and sections of controls to see if it fixed the problem, and then start to isolate even further.&lt;/p&gt; &lt;p&gt;Problem was, once you start removing controls, the code behind does&amp;nbsp;not compile, and then you have to start hacking your code behind so your site will compile and run. Once you remove more than a few controls, you need to make some serious changes and end up not really achieving anything by doing so. Ok for relatively simple pages, but a nightmare for complex pages. I wanted a way where I didn't break the code behind, but could easily remove controls from the page to try and isolate the issue.&lt;/p&gt; &lt;p&gt;Enter &lt;em&gt;dodgy debugging&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;To do this, I simply wrapped portions of the page in a Panel control and set its visibility to false. This still allowed all the code behind to compile and run fine, but because the visibility of the panel was false, the content within the panel would not be rendered at all.&lt;/p&gt; &lt;p&gt;So basically, portions of the page were wrapped in:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&amp;lt;asp:Panel id="pnl" runat="server" Visible="false"&amp;gt;&lt;br&gt;........&lt;br&gt;&amp;lt;/asp:Panel&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;I initially wrapped fairly large sections of the page, then reduced the number of controls within the panel,&amp;nbsp;until I could&amp;nbsp;isolate the control that was causing a double postback to my page.&lt;/p&gt; &lt;p&gt;Once I found the culprit, I fixed the issue and removed all the newly added panels from the page. Good to go.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4521010" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pglavich/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/Controls/default.aspx">Controls</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/debugging/default.aspx">debugging</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/Web+2.0/default.aspx">Web 2.0</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/ASP.NET+AJAX/default.aspx">ASP.NET AJAX</category></item><item><title>Debugging Javascript on a Live site - Fun and Games</title><link>http://weblogs.asp.net/pglavich/archive/2006/11/02/Debugging-Javascript-on-a-Live-site-_2D00_-Fun-and-Games.aspx</link><pubDate>Wed, 01 Nov 2006 21:17:36 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:785997</guid><dc:creator>Glav</dc:creator><slash:comments>8</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/pglavich/rsscomments.aspx?PostID=785997</wfw:commentRss><comments>http://weblogs.asp.net/pglavich/archive/2006/11/02/Debugging-Javascript-on-a-Live-site-_2D00_-Fun-and-Games.aspx#comments</comments><description>&lt;p&gt;I was discussing debugging of Javascript on one of the ASP.NET Ajax forums recently and thought I'd share how I go about it, as you'd be surprised how many people are unaware of this capability.&lt;/p&gt; &lt;p&gt;Note: This only discusses getting the debugging process going, not other debugging techniques such as using tools like Fiddler and others...&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Scenario:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;A site is experiencing a Javascript error (ie. some alert box in Internet Explorer) and you need to fix it, or some other script related issue.&lt;/p&gt; &lt;p&gt;The site is live.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Approach:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I want to load the site up in Visual Studio 2005 and use its script debugging capabilities to try and nut out the issue.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Pre Requisites:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;In internet explorer, you must have the following options/settings unchecked:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/DebuggingJavascriptFunandGames_F451/image03.png" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="115" src="http://www.theglavs.com/article_Images/DebuggingJavascriptFunandGames_F451/image0_thumb1.png" width="328" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;You can uncheck both the DIsable Script Debugging options from the &lt;strong&gt;Tools &lt;/strong&gt;--&amp;gt; &lt;strong&gt;Internet Options&lt;/strong&gt; menu selection, then select the &lt;strong&gt;Advanced&lt;/strong&gt; Tab.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Method:&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Load up Visual Studio 2005, create a new Web site. Edit the properties page of the site (right click on the website project in the solution explorer window, and select properties.&lt;/p&gt; &lt;p&gt;Select the 'Start Options' in the left pan, and choose the 'Start URL' option in the right pane.&lt;/p&gt; &lt;p&gt;Enter the URL of the site and/or page you wish to debug.&lt;/p&gt; &lt;p&gt;Start a debugging session by hitting F5 or pressing the play button.&lt;/p&gt; &lt;p&gt;When the browser is open, select the Debug' --&amp;gt; Windows --&amp;gt; Script Explorer option in Visual Studio.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/DebuggingJavascriptFunandGames_F451/image01.png" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="76" src="http://www.theglavs.com/article_Images/DebuggingJavascriptFunandGames_F451/image0_thumb11.png" width="372" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;You will then see a window that lists out all the scripts that have been loaded by this page, including the page itself. This window will also include any scripts loaded via a WebResource call.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/DebuggingJavascriptFunandGames_F451/image011.png" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="142" src="http://www.theglavs.com/article_Images/DebuggingJavascriptFunandGames_F451/image0_thumb111.png" width="283" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Now here is the tricky bit (well ok, more tricky....). If you double click on one of the entries in the window, you should see the relevant script in the content editor window. You can then place breakpoints, inspect variables and almost all the debugging goodness that goes with server side debugging. Visual Studio does have some quirks though, in that sometimes double clicking on an entry does not reveal the script. You often need to double click on another entry (usually the page is best), then double click on that entry again, or double click on some other entry, then back on the entry you originally wanted. Basically, you need to do the "&lt;em&gt;double click dance&lt;/em&gt;". I told you its tricky, but unfortunately VS.Net does not always play well. The rewards are worth it though. Once your script is displayed, you can use all the debugging features that you are used to, making it much easier to find those errors. Although, sometimes the timing of script loading can get even more tricky.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.theglavs.com/article_Images/DebuggingJavascriptFunandGames_F451/image011.png" atomicselection="true"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="371" src="http://www.theglavs.com/article_Images/DebuggingJavascriptFunandGames_F451/image0_thumb11.png" width="302" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Happy debugging....&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=785997" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/pglavich/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/pglavich/archive/tags/debugging/default.aspx">debugging</category></item></channel></rss>