<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.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>Search results for 'app:weblogs' matching tags 'Visual Studio 2005' and '.NET 2.0'</title><link>http://msmvps.com/search/SearchResults.aspx?q=app:weblogs&amp;tag=Visual+Studio+2005,.NET+2.0&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:weblogs' matching tags 'Visual Studio 2005' and '.NET 2.0'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>DevTeach 2009 Vancouver</title><link>http://msmvps.com/blogs/peterritchie/archive/2009/03/26/devteach-2009-vancouver.aspx</link><pubDate>Thu, 26 Mar 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1681658</guid><dc:creator>PeterRitchie</dc:creator><description>&lt;p&gt;The schedule for DevTeach 2009 Vancouver has been announced (&lt;a href="http://www.devteach.com/" title="http://www.devteach.com/"&gt;http://www.devteach.com/&lt;/a&gt;).&amp;nbsp; There&amp;rsquo;s lots of great software development sessions from some of the leaders in our industry.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re planning on improving yourself, this is the conference to go to.&amp;nbsp; Not only can you attend excellent sessions; but you can hob-knob with the presenters and pick their brains.&lt;/p&gt;
&lt;p&gt;If you have a friend or co-worker who&amp;rsquo;s interested, there&amp;rsquo;s a limited-time two-for-one offer for an even better price: &lt;a href="http://www.devteach.com/Register.aspx" title="http://www.devteach.com/Register.aspx"&gt;http://www.devteach.com/Register.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fmsmvps.com%2fblogs%2fpeterritchie%2farchive%2f2009%2f03%2f26%2fdevteach-2009-vancouver.aspx"&gt;&lt;img border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmsmvps.com%2fblogs%2fpeterritchie%2farchive%2f2009%2f03%2f26%2fdevteach-2009-vancouver.aspx" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Who's Referencing Whom?</title><link>http://msmvps.com/blogs/peterritchie/archive/2007/10/12/who-s-referencing-whom.aspx</link><pubDate>Fri, 12 Oct 2007 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1244908</guid><dc:creator>PeterRitchie</dc:creator><description>&lt;p&gt;When developing any sort of application, debugging in inevitable.&amp;nbsp; Sometimes, part of that debugging means trying to figure out why objects haven&amp;#39;t been collected and therefore figuring out what object is referencing the object that has yet to be collected.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s many reasons why you&amp;#39;d want to find out what object is referencing, like suspected memory &amp;quot;leaks&amp;quot;.&lt;/p&gt;
&lt;p&gt;With Visual Studio (and MDbg) you can use a tool called SOS (or Son&amp;nbsp;Of&amp;nbsp;Strike).&amp;nbsp; This is included in the .NET installation.&amp;nbsp; To use SOS you first need to enable unmanaged debugging in your project (Project\Properties, Debug tab, check &amp;quot;Enable unmanaged code debugging&amp;quot; in the &amp;quot;Enable Debuggers&amp;quot; section).&amp;nbsp; Once unmanaged debugging is enabled you can then debug your application.&amp;nbsp; To use SOS once debugging, you need to load the extension (every time a new debugging session is started).&amp;nbsp; Once a breakpoint has been hit, open the Immediate Window and type &lt;font face="courier new,courier"&gt;.load sos&lt;/font&gt;&lt;font face="Arial"&gt; which should result in the following:&lt;/font&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="courier new,courier"&gt;.load sos&lt;br /&gt;extension C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\sos.dll loaded&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;With SOS loaded, you can find out if any objects of a particular type are currently in memory with the &amp;quot;dumpheap -type&amp;quot; command, for example:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="courier new,courier"&gt;!dumpheap -type NamespaceName.TypeName&lt;br /&gt;&amp;nbsp;Address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Size&lt;br /&gt;&lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;012b2db8&lt;/font&gt; 009159c4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 328&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;total 1 objects&lt;br /&gt;Statistics:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MT&amp;nbsp;&amp;nbsp;&amp;nbsp; Count&amp;nbsp;&amp;nbsp;&amp;nbsp; TotalSize Class Name&lt;br /&gt;009159c4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 328 NamespaceName.TypeName&lt;br /&gt;Total 1 objects&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;This lists all objects of the requested type, their address, their MethodTable (MT), and the count of each object per MethodTable.&lt;/p&gt;
&lt;p&gt;Once you have the object&amp;#39;s address you can then find out what objects are referencing that particular instance.&amp;nbsp; This is done with the &lt;font face="courier new,courier"&gt;gcroot&lt;/font&gt; command:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="courier new,courier"&gt;!gcroot &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;012b2db8&lt;/font&gt;&lt;br /&gt;Note: Roots found on stacks may be false positives. Run &amp;quot;!help gcroot&amp;quot; for&lt;br /&gt;more info.&lt;br /&gt;Error during command: warning! Extension is using a feature which Visual Studio does not implement.&lt;br /&gt;&amp;nbsp;&lt;br /&gt;Scan Thread 4756 OSTHread 1294&lt;br /&gt;ESP:12f0dc:Root:012b2db8(WindowsApplication1.Form1)-&amp;gt;&lt;br /&gt;012bb104(WindowsApplication1.Form2)-&amp;gt;&lt;br /&gt;012bb254(System.Collections.Generic.List`1[[NamespaceName.TypeName, WindowsApplication1]])-&amp;gt;&lt;br /&gt;012bc178(System.Object[])-&amp;gt;&lt;br /&gt;012bc16c(NamespaceName.TypeName)&lt;br /&gt;Scan Thread 3496 OSTHread da8&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;In this particular example, the above tells us that our object (&lt;font face="courier new,courier"&gt;012bc16c(NamespaceName.TypeName)&lt;/font&gt;) is referenced by an Object array (&lt;font face="courier new,courier"&gt;012bc178(System.Object[])&lt;/font&gt;), which is referenced by a &lt;font face="courier new,courier"&gt;List&amp;lt;T&amp;gt;&lt;/font&gt; object (&lt;font face="courier new,courier"&gt;012bb254(System.Collections.Generic.List`1[[NamespaceName.TypeName, WindowsApplication1]])&lt;/font&gt;), which is referenced by &lt;font face="courier new,courier"&gt;Form2&lt;/font&gt; (&lt;font face="courier new,courier"&gt;012bb104(WindowsApplication1.Form2)&lt;/font&gt;), which is referenced by a &lt;font face="courier new,courier"&gt;Form1&lt;/font&gt; object(&lt;font face="courier new,courier"&gt;ESP:12f0dc:Root:012b2db8(WindowsApplication1.Form1)&lt;/font&gt;).&lt;br /&gt;&lt;/p&gt;</description></item><item><title>.NET Framework 2.0 Service Pack 1</title><link>http://msmvps.com/blogs/peterritchie/archive/2007/05/22/net-framework-2-0-service-pack-1.aspx</link><pubDate>Tue, 22 May 2007 05:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:919506</guid><dc:creator>PeterRitchie</dc:creator><description>&lt;p&gt;I noticed mention of .NET Framework 2.0 Service Pack 1 on a Microsoft site today.&lt;/p&gt;
&lt;p&gt;The BCL Team&amp;#39;s latest blog entry &lt;a href="http://blogs.msdn.com/bclteam/archive/2007/05/21/the-regexoptions-compiled-flag-and-slow-performance-on-64-bit-net-framework-2-0-josh-free.aspx"&gt;http://blogs.msdn.com/bclteam/archive/2007/05/21/the-regexoptions-compiled-flag-and-slow-performance-on-64-bit-net-framework-2-0-josh-free.aspx&lt;/a&gt; mentions a fix that will make it into the .NET Framework 2.0 SP 1.&amp;nbsp; Seems an inevitable release of SP1 for .NET Framework 2.0 is pretty official.&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>