<?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>Steven Pratschner's .Net CF WebLog : Diagnostics</title><link>http://blogs.msdn.com/stevenpr/archive/tags/Diagnostics/default.aspx</link><description>Tags: Diagnostics</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>The CLRProfiler for the .Net Compact Framework, Part IV: The Call Tree View</title><link>http://blogs.msdn.com/stevenpr/archive/2008/02/12/the-clrprofiler-for-the-net-compact-framework-part-iv-the-call-tree-view.aspx</link><pubDate>Tue, 12 Feb 2008 21:10:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7649678</guid><dc:creator>stevenpr</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/stevenpr/comments/7649678.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevenpr/commentrss.aspx?PostID=7649678</wfw:commentRss><description>&lt;p&gt;&lt;font size="2"&gt;This series of posts provides an introduction to using the CLRProfiler for the .Net Compact Framework.&amp;#160; In previous posts (&lt;a href="http://blogs.msdn.com/stevenpr/archive/2007/10/17/the-clrprofiler-for-the-net-compact-framework-part-1-getting-started.aspx"&gt;part 1&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/stevenpr/archive/2007/10/18/the-clrprofiler-for-the-net-compact-framework-part-ii-histograms-and-show-who-allocated.aspx"&gt;part 2&lt;/a&gt;, and &lt;a href="http://blogs.msdn.com/stevenpr/archive/2007/11/28/the-clrprofler-for-the-net-compact-framework-part-iii-the-timeline-view.aspx"&gt;part 3&lt;/a&gt;) we've looked at various profiler features as we try to solve a performance problem with a sample application.&amp;#160; So far, we've learned that our performance problem is due to excessive boxing of value types.&amp;#160; We've also learned what type of objects we are boxing and what methods in the sample are causing the boxing to occur.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;In some cases, knowing which method is causing the problem is all you need, especially if the method is small and straightforward.&amp;#160; However, there are cases where even more detail is needed.&amp;#160; In this post I'll use the Call Tree View to determine the &lt;em&gt;exact line of source code&lt;/em&gt; that is causing my performance issue!&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;After you've finished profiling, you can bring up the Call Tree View from the summary page:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;img src="http://farm3.static.flickr.com/2002/2231705450_aee3a468b8.jpg" /&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1&gt;The Call Tree View&lt;/h1&gt;  &lt;p&gt;&lt;font size="2"&gt;The Call Tree View shows every allocation made as a result of every method call.&amp;#160; For all but the simplest programs the Call Tree View contains a huge amount of data.&amp;#160; Fortunately, navigating through all this data isn't very hard once you get used to a few tricks.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Method calls are shown in black and object allocations are shown in green.&amp;#160; For example, the following picture shows the initial state of the Call Tree View.&amp;#160; You can see that only one method (the program's &lt;font face="Courier New"&gt;Main&lt;/font&gt; method) has been called at this outermost level.&amp;#160; You can also see that several allocations have already been made.&amp;#160; These initial allocations are made by the CLR just before it starts executing a program.&amp;#160; As you can see, these initial allocations represent several of the common exception types as well as the initial Application Domain.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;img src="http://farm3.static.flickr.com/2125/2230902073_7c65acbb7e.jpg" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Along with the individual method calls and object allocations, the Call Tree View also shows summary statistics such as the number of method calls that result from a given call, the number of bytes and objects allocated by a given call and so on.&amp;#160; You can sort the data either by number of calls or by the amount of memory allocated.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;As you start to expand the tree, you'll notice that one child node at each level is highlighted in bold.&amp;#160; The highlighted node represents the method that has allocated the most memory (or generated the most calls, depending on your sort preference).&amp;#160; This is the key to drilling into the data quickly - just follow the highlighted nodes until you find the method you are looking for.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Back to the Example&lt;/h2&gt;  &lt;p&gt;&lt;font size="2"&gt;In previous posts we've established that the objects we are boxing are of type &lt;font face="Courier New"&gt;Box.Block&lt;/font&gt; and that the boxing is occurring in calls to &lt;font face="Courier New"&gt;RotateGameBlocks&lt;/font&gt; and &lt;font face="Courier New"&gt;InitializeGameBlocks&lt;/font&gt;.&amp;#160; By drilling through the data in the Call Tree View we can find out exactly which line of code in &lt;font face="Courier New"&gt;RotateGameBlocks&lt;/font&gt; (or &lt;font face="Courier New"&gt;InitializeGameBlocks&lt;/font&gt;) is causing the boxing to occur.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The following picture shows the result of following the highlighted notes until I have found the &lt;font face="Courier New"&gt;RotateGameBlocks&lt;/font&gt; method.&amp;#160; Some of the methods in the tree look familiar, like &lt;font face="Courier New"&gt;Main&lt;/font&gt;, and &lt;font face="Courier New"&gt;Application.Run&lt;/font&gt;, but many methods don't.&amp;#160; Method names that you don't recognize are likely part of NetCF's internal implementation.&amp;#160; For example, methods that contain &amp;quot;&lt;font face="Courier New"&gt;AGL&lt;/font&gt;&amp;quot; in their name are part of NetCF's implementation of Windows Forms. &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;img src="http://farm3.static.flickr.com/2147/2230902115_e5b90213f5.jpg" /&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;When looking at the child nodes of &lt;font face="Courier New"&gt;RotateGameBlocks&lt;/font&gt;, we see a green line representing the allocations of &lt;font face="Courier New"&gt;Box.Block&lt;/font&gt;.&amp;#160; The Objects column tells us that a call to &lt;font face="Courier New"&gt;RotateGameBlocks&lt;/font&gt; causes 14,400 instances of &lt;font face="Courier New"&gt;Box.Block&lt;/font&gt; to be allocated.&amp;#160; Furthermore, we can see that &lt;font face="Courier New"&gt;RotateGameBlocks&lt;/font&gt; calls &lt;font face="Courier New"&gt;ArrayList.set_Item&lt;/font&gt; 14,400 times.&amp;#160; The fact that the number of calls to &lt;font face="Courier New"&gt;ArrayList.set_Item&lt;/font&gt; and the number of instances of &lt;font face="Courier New"&gt;Box.Block&lt;/font&gt; that are allocated are the same indicates that the calling &lt;font face="courier "&gt;ArrayList.set_Item&lt;/font&gt; is the line in my sample that is causing our boxing to occur.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;In my next post I'll describe a set of managed APIs you can use to control profiling programmatically.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Thanks,&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Steven&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="1"&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7649678" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevenpr/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>The CLRProfiler for the .Net Compact Framework, Part II: Histograms and "Show who Allocated"</title><link>http://blogs.msdn.com/stevenpr/archive/2007/10/18/the-clrprofiler-for-the-net-compact-framework-part-ii-histograms-and-show-who-allocated.aspx</link><pubDate>Thu, 18 Oct 2007 20:22:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5514436</guid><dc:creator>stevenpr</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/stevenpr/comments/5514436.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevenpr/commentrss.aspx?PostID=5514436</wfw:commentRss><description>&lt;p&gt;&lt;font size="2"&gt;Yesterday I started a series of posts on how the use the CLRProfiler for the .Net Compact Framework.&amp;#xA0; The &lt;a href="http://blogs.msdn.com/stevenpr/archive/2007/10/17/the-clrprofiler-for-the-net-compact-framework-part-1-getting-started.aspx"&gt;first post&lt;/a&gt; contained the basic information you need to get started.&amp;#xA0; I described how to install the profiler, launch an application on the device, and collect profiling data.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;In order to direct the discussion, I've written a sample application that exhibits a performance problem that is surprisingly easy to fall into.&amp;#xA0; Throughout these posts I'll show you how to use the profiler to diagnose the problem.&amp;#xA0; To refresh your memory, the sample application is a basic game and the performance problem is that the main windows paints way too slowly.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;After I stopped profiling the game in the first post, following summary page was displayed.&amp;#xA0; &lt;/font&gt;&amp;#xA0;&lt;img id="id" src="http://farm3.static.flickr.com/2366/1607249692_781068c831.jpg" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;font size="2"&gt;In this post I'll use some of the histograms to begin diagnosing our performance problem.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;h1&gt;Histograms&lt;/h1&gt;  &lt;p&gt;&lt;font size="2"&gt;The first thing that stands out at me when looking at the summary form is the amount of managed data I'm creating.&amp;#xA0; While profiling the painting portion of my application I generated over 6MB of managed objects.&amp;#xA0; That's clearly way too much for a relatively simple operation like painting my main window.&amp;#xA0; My first step in determining what's going on is to get some basic statistics about the objects my application is using.&amp;#xA0; For example, I'm interested in which objects I'm creating, how many of them there are and how long they live.&amp;#xA0; This data can be obtained by looking at some of the histograms the profiler offers.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;I can choose to view a histogram for all objects created as my application ran or only for those objects that were in the GC heap when my application exited.&amp;#xA0; In my scenario I need to look at all objects.&amp;#xA0; If I were to only look at the objects alive at the end of the run I may miss some important trend that occurred earlier on.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Clicking the &amp;quot;&lt;em&gt;Histogram&lt;/em&gt;&amp;quot; button next to the &amp;quot;&lt;em&gt;Allocated Bytes&lt;/em&gt;&amp;quot; value displays the following graph:&lt;/font&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt; &lt;font size="2"&gt;&lt;img id="id" src="http://farm3.static.flickr.com/2116/1618435871_825a99788d.jpg" /&gt; &lt;/font&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The histogram form has two panes. The pane on the right describes how many instances of each type of object were created and the total size of those instances.&amp;#xA0; The pane on the left graphs type instances by size.&amp;#xA0; The color coding next to the types in the right pane matches the bars in the left pane which show the relative amounts of objects created.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;A quick glance at this form helps narrow my suspicions about what's causing my performance issue.&amp;#xA0; As you can see, about 97% of the objects I created were of type &lt;font face="Courier New"&gt;Box.Block&lt;/font&gt; as indicated by the red box on the right hand pane and the red bar in the left hand pane.&amp;#xA0; I can also see that each instance of &lt;font face="Courier New"&gt;Box.Block&lt;/font&gt; is relatively small at an average size of 136 bytes (see the right hand pane).&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;h1&gt;Who Allocated all those Objects?&lt;/h1&gt;  &lt;p&gt;&lt;font size="2"&gt;Now that I know the majority of my objects are instances of &lt;font face="Courier New"&gt;Box.Block&lt;/font&gt;, I'd like to see where in my application those instances are getting created.&amp;#xA0; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;To determine the source of my allocations I can right-click on the bar that represents &lt;font face="Courier New"&gt;Box.Block&lt;/font&gt; in the histogram and select &amp;quot;&lt;em&gt;Show Who Allocated&lt;/em&gt;&amp;quot; (the bar turns black when selected):&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;img id="id" src="http://farm3.static.flickr.com/2034/1621134688_0a16602c4b.jpg" /&gt; &lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Doing so brings up a window referred to as an Allocation Graph:&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;img id="id" src="http://farm3.static.flickr.com/2279/1619717659_ec0f0d62b3.jpg" /&gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;The Allocation Graph traces the flow of every call that allocated an instance of &lt;font face="Courier New"&gt;Box.Block&lt;/font&gt;.&amp;#xA0; I typically interpret this graph starting with the rightmost node.&amp;#xA0; This node represents all instances of &lt;font face="Courier New"&gt;Box.Block&lt;/font&gt; in the system.&amp;#xA0; Stepping back one level to the left we see two nodes representing methods that created instances of &lt;font face="Courier New"&gt;Box.Block&lt;/font&gt;: &lt;font face="Courier New"&gt;Form1.RotateGameBlocks&lt;/font&gt; and &lt;font face="Courier New"&gt;Form1.InitializeGameBlocks&lt;/font&gt;. The data in these nodes tell us that 75% of the &lt;font face="Courier New"&gt;Block&lt;/font&gt;s were created in &lt;font face="Courier New"&gt;RotateGameBlocks&lt;/font&gt; and 25% were created in &lt;font face="Courier New"&gt;InitializeGameBlocks&lt;/font&gt;.&amp;#xA0; Notice that the width of the lines connecting the nodes represents the percentage of instances that call created.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Now that I know where my objects are coming from I can dig into my code to see what's going on.&amp;#xA0; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;In some scenarios, the information we've learned so far may be all that we need to fix the problem.&amp;#xA0; However, there are a few more pieces of data that may be required in some cases.&amp;#xA0; For example, it may be useful to know the times at which &lt;font face="Courier New"&gt;Blocks&lt;/font&gt; were created and destroyed.&amp;#xA0; Also, if &lt;font face="Courier New"&gt;RotateGameBlocks&lt;/font&gt; and &lt;font face="Courier New"&gt;InitializeGameBlocks&lt;/font&gt; are long, complicated methods, we may need to know the exact calls within those methods that caused the allocations.&amp;#xA0; I'll describe how to get this information in future posts.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Thanks,&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2"&gt;Steven&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5514436" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevenpr/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>The CLRProfiler for the .Net Compact Framework, Part 1: Getting Started</title><link>http://blogs.msdn.com/stevenpr/archive/2007/10/17/the-clrprofiler-for-the-net-compact-framework-part-1-getting-started.aspx</link><pubDate>Thu, 18 Oct 2007 04:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5502740</guid><dc:creator>stevenpr</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/stevenpr/comments/5502740.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevenpr/commentrss.aspx?PostID=5502740</wfw:commentRss><description>&amp;nbsp;&lt;A href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx" mce_href="http://msdn2.microsoft.com/en-us/vstudio/aa700831.aspx"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Version 3.5 of the .Net Compact Framework&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;contains a new memory profiler called the CLRProfiler.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The CLRProfiler is a great tool for looking into the details of how your application is allocating and using managed objects.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example, the profiler allows you to look at the contents of the GC heap at any point in time, provides a historical record of what's going on in the heap, let's you see which calls in your application are allocating which objects and so on.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This level of detail is often needed to diagnose memory-related issues in your device applications.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The Compact Framework's version of the CLRProfiler is an adaptation of the profiler that has been available for the full .Net Framework for some time.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;In this series of posts I'll walk you through the primary features of the CLRProfiler for the .Net Compact Framework.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The profiler contains numerous ways to analyze data about the GC heap so instead of briefly touching on all of them, I'll go into depth on the views I've found most useful.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;We'll be looking at the profiler by way of an example, as I've found that learning a new tool is often easier if you have a specific problem to solve rather than just looking at the tool's features without any context.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you'd like more information on a view that I don't cover here you can read the &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a362781c-3870-43be-8926-862b40aa0cd0&amp;amp;DisplayLang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a362781c-3870-43be-8926-862b40aa0cd0&amp;amp;DisplayLang=en"&gt;document that ships with the full Framework's version of the profiler&lt;/A&gt;.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 12pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;&lt;STRONG&gt;Our Sample&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;The sample I'll use to describe the profiler is the beginnings of a game I started to write using the Compact Framework.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;All the game currently does is allow you to start a new game and to rotate a set of blocks on the screen.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Here's a simple view of the application:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/stevenjpr/1605122889/"&gt;&lt;IMG height=559 alt=prof1 src="http://farm3.static.flickr.com/2364/1605122889_08f14f38c7_o.jpg" width=371&gt;&lt;/A&gt; 
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;FONT face=Verdana&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;The performance problem I'm having with this game involves my drawing logic.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The blocks on the screen draw very slowing.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;On my Dell Axim I can literally see each column of blocks paint individually.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Throughout these posts I'll use the CLRProfiler to figure out what I can do to make my game paint more quickly.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 12pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;&lt;STRONG&gt;Launching an Application with the CLRProfiler&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;The CLRProfiler ships in the &lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=C8174C14-A27D-4148-BF01-86C2E0953EAB&amp;amp;displaylang=en"&gt;.Net Compact Framework Power Toys&lt;/A&gt; package.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;After installing the Power Toys you can find the CLRProfiler executable (NetCFClrProfiler.exe) in the bin directory of the .Net SDK.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;On my machine that directory is c:\Program Files\Microsoft.Net\SDK\CompactFramework\v3.5\bin.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The Power Toys setup program also adds a menu item for the profiler to the Windows Start menu.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;The main window of the profiler is strikingly simple:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/stevenjpr/1606427830/"&gt;&lt;IMG height=171 alt=prof2 src="http://farm3.static.flickr.com/2271/1606427830_e2a1bdfc80_o.jpg" width=327&gt;&lt;/A&gt; 
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;Through this main window you can start and stop applications, take snapshots of the GC heap, and control various profiling options.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;These options include control over whether profiling is currently active and whether allocations, calls or both are logged.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;Clicking the "&lt;EM&gt;Start Application&lt;/EM&gt;…" button displays the following form:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/stevenjpr/1607249510/"&gt;&lt;IMG height=213 alt=prof3 src="http://farm3.static.flickr.com/2021/1607249510_6d7c969551_o.jpg" width=641&gt;&lt;/A&gt; 
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Verdana&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;On this form you enter the name of the device you'd like to connect to, the fully qualified path to the device executable you'd like to profile, and any command line parameters to be passed to the application.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The CLRProfiler supports profiling applications on devices connected either over ActiveSync or TCP/IP.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can also profile applications running on emulators.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The profiler supports the same types of devices that&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;the &lt;A href="http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx"&gt;.Net Compact Framework Performance Monitor&lt;/A&gt; does(in fact, the device selection and connectivity mechanisms are shared between the two tools).&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in"&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;In my example I have a device connected over ActiveSync and the name of my application is &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'"&gt;box.exe&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Verdana"&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Selecting "&lt;EM&gt;Connect&lt;/EM&gt;" from the launch dialog starts the application on device and begins profiling.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;At this point just run your application as you normally would.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;The CLRProfiler causes your application to run much slower than normal.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;In order to speed up the debugging process you can turn profiling on and off for different sections of your application using the "&lt;EM&gt;Profiling active&lt;/EM&gt;" checkbox on the profiler's main form.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;When you're done profiling your application, you can stop it either by selecting the "&lt;EM&gt;Kill Application&lt;/EM&gt;" button on the main form of the CLRProfiler or by just closing the application directly on the device.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 12pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;&lt;STRONG&gt;The Summary Form&lt;/STRONG&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;After your application exits the CLRProfiler displays the following summary form:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/stevenjpr/1607249692/"&gt;&lt;IMG height=263 alt=prof4 src="http://farm3.static.flickr.com/2366/1607249692_781068c831.jpg" width=500&gt;&lt;/A&gt; 
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT face=Verdana&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;The summary form provides some general statistics about the use of managed memory as your application ran:&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.75in; DIRECTION: ltr; unicode-bidi: embed" type=circle&gt;
&lt;LI style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Heap Statistics.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; The statistics displayed in this group box describe the total size of the objects in the managed heap.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The "&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-STYLE: italic; FONT-FAMILY: Verdana"&gt;Allocated Bytes"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; value counts the total size of allocations made as the application was running.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;When the Compact Framework garbage collector detects significant fragmentation in the heap, it will compact it.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The "&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-STYLE: italic; FONT-FAMILY: Verdana"&gt;Relocated Bytes&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;" value shows how many bytes the garbage collector moved around during compaction.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-STYLE: italic; FONT-FAMILY: Verdana"&gt;Final Heap Bytes&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;" shows the size of the managed heap when the application exited and "&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-STYLE: italic; FONT-FAMILY: Verdana"&gt;Objects Finalized&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;" is what you'd expect: the number of objects that had finalizers to run.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Note that the Heap Statistics group also provides a count of critical finalizers run.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The .Net Compact Framework doesn't have the notion of critical finalization so this value will always be 0.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: Verdana"&gt;There are several buttons in this box that launch viewers that allow you to analyze data in various ways.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;You can view data in histograms based on object size, age, address and so on.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I'll describe most of these views in detail in subsequent posts.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.75in; DIRECTION: ltr; unicode-bidi: embed" type=circle&gt;
&lt;LI style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Garbage Collection Statistics.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; This group box tells you how many garbage collections occurred while your application was being profiled and how many of those collections were induced by calls to &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;GC.Collect&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The "&lt;EM&gt;Timeline&lt;/EM&gt;" button enables you to see how the contents of the GC heap changes over time.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I think this is one of the coolest views.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I'll describe it in great detail in a subsequent post.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.75in; DIRECTION: ltr; unicode-bidi: embed" type=circle&gt;
&lt;LI style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;GC Handle Statistics.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; The GC Handles group box shows you how many handles were created and destroyed while your application ran.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Keep in mind that the Compact Framework CLR creates GCHandles under the covers as it executes your application so all of the handles you see here aren't likely to have been created explicitly by you.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.75in; DIRECTION: ltr; unicode-bidi: embed" type=circle&gt;
&lt;LI style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"&gt;&lt;SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt;Profiling Statistics.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"&gt; The CLRProfiler enables you to take snapshots of the GC heap as your application is running.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I didn't do this while profiling my application, but if I would have I would be able to choose a snapshot from the dropdown and view it.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;Getting back to our example, there are several pieces of data on this form that concern me, or are unexpected.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The key to analyzing performance data such as this is not just looking at the raw values, but in interpreting the values in the context of what your application was doing as it was being profiled.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;For example, I profiled the time my application spent painting, yet I see that 5 garbage collections occurred and I created over 6 MB worth of objects.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This data leads me to believe that I'm making the garbage collector work harder than it should for my scenario.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Clearly there shouldn't be so much activity going on in the managed heap while I'm painting boxes on the screen!&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;In my next post, we'll use some of the histogram views to see how many objects my application is creating and of what type they are.&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;Thanks,&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;Steven&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 10pt; MARGIN: 0in; FONT-FAMILY: Verdana"&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Rockwell','serif'; mso-ansi-language: EN"&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/SPAN&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5502740" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevenpr/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>.Net Compact Framework: “Hey, what happened to the diagnostic tools?”</title><link>http://blogs.msdn.com/stevenpr/archive/2007/09/12/net-compact-framework-hey-what-happened-to-the-diagnostic-tools.aspx</link><pubDate>Thu, 13 Sep 2007 03:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4886477</guid><dc:creator>stevenpr</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/stevenpr/comments/4886477.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevenpr/commentrss.aspx?PostID=4886477</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;If you’ve installed the Beta2 version of Orcas you may have noticed that the NetCF diagnostic tools&amp;nbsp;(RPM, CLRProfler, ...)&amp;nbsp;are missing.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Don’t worry, these haven’t been cut from Orcas, they will just be distributed via the web in a separate “power toys” pack.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;A CTP of these tools is now available at: &lt;SPAN style="COLOR: #1f497d"&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=C8174C14-A27D-4148-BF01-86C2E0953EAB&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=C8174C14-A27D-4148-BF01-86C2E0953EAB&amp;amp;displaylang=en&lt;/A&gt;&lt;/SPAN&gt; .&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This CTP works with Orcas Beta2.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;We intend to distribute the final Power Toys release at the same time that Orcas ships.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Thanks,&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;Steven&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Rockwell','serif'; mso-ansi-language: EN"&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4886477" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevenpr/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>Using the .NetCF Remote Performance Monitor to find memory leaks: A real world example</title><link>http://blogs.msdn.com/stevenpr/archive/2007/03/23/using-the-netcf-remote-performance-monitor-to-find-memory-leaks-a-real-world-example.aspx</link><pubDate>Fri, 23 Mar 2007 20:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1938492</guid><dc:creator>stevenpr</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/stevenpr/comments/1938492.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevenpr/commentrss.aspx?PostID=1938492</wfw:commentRss><description>&lt;P&gt;A few weeks ago I posted an entry describing &lt;A class="" href="http://blogs.msdn.com/stevenpr/archive/2007/03/08/finding-managed-memory-leaks-using-the-net-cf-remote-performance-monitor.aspx" mce_href="http://blogs.msdn.com/stevenpr/archive/2007/03/08/finding-managed-memory-leaks-using-the-net-cf-remote-performance-monitor.aspx"&gt;how to use the .Net Compact Framework Remote Performance Monitor to find managed memory leaks&lt;/A&gt;.&amp;nbsp; The other day I ran across a post from &lt;A class="" href="http://blogs.msdn.com/controlpanel/blogs/www.satter.org" mce_href="http://blogs.msdn.com/controlpanel/blogs/www.satter.org"&gt;Rabi&amp;nbsp;Satter&lt;/A&gt;&amp;nbsp;describing how he used to tool to solve a critical leak for one of his customers.&amp;nbsp; His&amp;nbsp;real world experience&amp;nbsp;provides a much more complete memory leak example than my original post did.&amp;nbsp; Check it out: &lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;. &lt;A href="http://www.satter.org/2007/03/thank_god_for_c.html"&gt;http://www.satter.org/2007/03/thank_god_for_c.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;Steven&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Rockwell','serif'; mso-ansi-language: EN"&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1938492" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevenpr/archive/tags/GC/default.aspx">GC</category><category domain="http://blogs.msdn.com/stevenpr/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>Using the .Net Compact Framework Remote Performance Monitor to Optimize your application's memory usage</title><link>http://blogs.msdn.com/stevenpr/archive/2007/01/02/using-the-net-compact-framework-remote-performance-monitor-to-optimize-your-application-s-memory-usage.aspx</link><pubDate>Wed, 03 Jan 2007 02:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1401044</guid><dc:creator>stevenpr</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/stevenpr/comments/1401044.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevenpr/commentrss.aspx?PostID=1401044</wfw:commentRss><description>&lt;P&gt;The &lt;A class="" href="http://dotnet.sys-con.com/read/issue/827.htm" target=_blank mce_href="http://dotnet.sys-con.com/read/issue/827.htm"&gt;November issue of .Net Developers Journal&lt;/A&gt;&amp;nbsp;includes a &lt;A class="" href="http://dotnet.sys-con.com/read/315037.htm" mce_href="http://dotnet.sys-con.com/read/315037.htm"&gt;new article on using the Remote Performance Montior&lt;/A&gt;.&amp;nbsp; In the article I describe how to interpret the various memory-related counters to optimize how your Compact Framework application uses memory on the device.&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Steven&lt;/P&gt;
&lt;P&gt;&lt;SPAN lang=EN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Rockwell','serif'; mso-ansi-language: EN"&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1401044" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevenpr/archive/tags/GC/default.aspx">GC</category><category domain="http://blogs.msdn.com/stevenpr/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>Auto-Deployment of Remote Performance Monitor Device-side Components</title><link>http://blogs.msdn.com/stevenpr/archive/2006/10/31/auto-deployment-of-remote-performance-monitor-device-side-components.aspx</link><pubDate>Wed, 01 Nov 2006 02:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:916140</guid><dc:creator>stevenpr</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/stevenpr/comments/916140.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevenpr/commentrss.aspx?PostID=916140</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;In my&amp;nbsp;&lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx"&gt;&lt;FONT face=Calibri size=3&gt;earlier post&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; on using the .Net Compact Framework Remote Performance Monitor, I describe that you must manually copy two files (netcfrtl.dll and netcflaunch.exe) to your device before you can launch an application to receive performance statistics.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;A href="http://blog.opennetcf.org/ctacke/"&gt;&lt;FONT face=Calibri size=3&gt;Chris Tacke&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; of &lt;/FONT&gt;&lt;A href="http://www.opennetcf.org/"&gt;&lt;FONT face=Calibri size=3&gt;OpenNetCF.org&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; recently got tired of this manual process and wrote a program you can use to automate the deployment of these two files.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Check out: &lt;/FONT&gt;&lt;A href="http://blog.opennetcf.org/ctacke/PermaLink,guid,793b6c03-496c-4187-a27c-bf369c67d713.aspx"&gt;&lt;FONT face=Calibri size=3&gt;http://blog.opennetcf.org/ctacke/PermaLink,guid,793b6c03-496c-4187-a27c-bf369c67d713.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Thanks for your help Chris,&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Steven&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Rockwell&gt;This posting is provided "AS IS" with no warranties, and confers no rights&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=916140" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevenpr/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>Analyzing Device Application Performance with the .Net Compact Framework Remote Performance Monitor</title><link>http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx</link><pubDate>Mon, 17 Apr 2006 20:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:577636</guid><dc:creator>stevenpr</dc:creator><slash:comments>59</slash:comments><comments>http://blogs.msdn.com/stevenpr/comments/577636.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevenpr/commentrss.aspx?PostID=577636</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Service Pack 1 of the .Net Compact Framework version 2 (see &lt;A HREF="/netcfteam/archive/2006/04/21/580901.aspx"&gt;http://blogs.msdn.com/netcfteam/archive/2006/04/21/580901.aspx&lt;/A&gt;) includes a new utility called the .Net Compact Framework Remote Performance Monitor (RPM).&amp;nbsp; The RPM helps you diagnose performance problems in your application by providing a dynamic, graphical view of various runtime performance statistics.&amp;nbsp; The performance statistics displayed by the RPM are those that are present in the ".stat" files in previous versions of the Compact Framework.&amp;nbsp; See David Kline's blog entry "&lt;A href="/davidklinems/archive/2005/12/09/502125.aspx"&gt;Monitoring Application Performance...&lt;/A&gt;" for a thorough description of all the counters viewable through the RPM.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;You have two choices when viewing data using RPM.&amp;nbsp; First, you can view the counters in a textual table format using the RPM tool itself, or you can view all the data the RPM gathers using the standard Windows Performance Monitor.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;This post provides instructions for installing and using the RPM.&amp;nbsp; This tool is a big step forward for .Net Compact Framework developers.&amp;nbsp; For the first time, you'll be able to to use standard performance tools to gain insight into your application's performance as it runs!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT face=Verdana size=3&gt;Installation&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The .Net CF Remote Performance Monitor includes some files that reside on the desktop machine and some files that must be present on the device.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Installing the desktop components is easy - just run the SP1 setup program.&amp;nbsp; After the installation completes, the RPM executable (&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;netcfrpm.exe&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;) is placed in the bin directory of Compact Framework SDK.&amp;nbsp; On my machine, this directory is &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\bin.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Installing the device-side components involves manually copying two files from the desktop machine to the device.&amp;nbsp; The SP1 setup program places the device-side files in the same directory as the cab file that matches your processor type and operation system version.&amp;nbsp; I have a Pocket PC 2003 SE device, so my device-side components are installed in &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\wce400\armv4&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;. The two files you must copy are &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;netcfrtl.dll &lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;and &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;netcflaunch.exe&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;.&amp;nbsp; Both of these files must be copied to the &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;\windows directory&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; of your device.&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV style="BORDER-LEFT-COLOR: #800000; BORDER-BOTTOM-COLOR: #800000; BORDER-TOP-STYLE: dotted; BORDER-TOP-COLOR: #800000; BORDER-RIGHT-STYLE: dotted; BORDER-LEFT-STYLE: dotted; BORDER-RIGHT-COLOR: #800000; BORDER-BOTTOM-STYLE: dotted"&gt;&lt;B&gt;&lt;FONT face=Verdana size=2&gt;Installation Notes for Windows Mobile 5.0 Devices&lt;/FONT&gt;&lt;/B&gt; 
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;There are two issues you may run into when installing the device-side RPM components on Windows Mobile 5.0 devices.&lt;BR&gt;&lt;BR&gt;&amp;nbsp;- Depending on the security configuration chosen by the device manufacturer, you may see a security prompt on the device the first time you launch the RPM. This prompt appears because &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;netcfrpm.dll&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; is not signed.&lt;BR&gt;&lt;BR&gt;- An additional installation step is necessary on Windows Mobile 5.0 devices to provision the device so the RPM can run. Provisioning involves copying the following XML text into a file and using the &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;rapiconfig&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; utility to send the XML file to the device.&lt;BR&gt;&lt;BR&gt;- &amp;lt;wap-provisioningdoc&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; - &amp;lt;characteristic type="Metabase"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - &amp;lt;characteristic type="RAPI\Windows\netcfrtl.dll\*"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;parm name="rw-access" value="3" /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;parm name="access-role" value="152" /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!-- 152 maps to "CARRIER_TPS | USER_AUTH | MANAGER"--&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/characteristic&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;/characteristic&amp;gt;&lt;BR&gt;&amp;lt;/wap-provisioningdoc&amp;gt;&lt;BR&gt;&lt;BR&gt;For example, if you pasted the above XML text into a file named &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;rpmprov.xml&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; you'd issue the following command from your desktop machine to provision your device:&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;rapiconfig /p rpmprov.xml&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT face=Verdana&gt;Launching the Remote Performance Monitor&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;To view dynamic performance statistics for your application, launch &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;netcfrpm.exe&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; from the desktop machine and select the &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;"Live Counters...."&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; option under the &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;File&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; menu.&amp;nbsp; Doing so displays the following window:&lt;/FONT&gt;&lt;/P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/stevenjpr/124431954/"&gt;&lt;IMG height=610 alt=TuneIn1 src="http://static.flickr.com/52/124431954_ae843e7c2a_o.jpg" width=810&gt;&lt;/A&gt; 
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Before you can view live statistics, you must connect the RPM to your device and specify the application you'd like to run.&amp;nbsp; The instructions for connecting the RPM to your device vary based on whether the connection between your desktop machine and your device is via Active Sync or an Ethernet connection.&amp;nbsp; If your connection is over ActiveSync, your device will automatically appear in the &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;Device&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; drop down in the RPM user interface.&amp;nbsp; If your desktop machine is connected to the device through a direct network connection, you must know the IP address and port number through which the RPM can connect to your device.&amp;nbsp; This information can be obtained by running &lt;FONT color=#000080&gt;netcflauch.exe&lt;/FONT&gt; from the &lt;FONT color=#000080&gt;\windows&lt;/FONT&gt; directory of your device.&amp;nbsp; Running &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;netcflaunch.exe&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; displays the following:&lt;/FONT&gt;&lt;/P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/stevenjpr/124431953/"&gt;&lt;IMG height=367 alt=Launcher src="http://static.flickr.com/52/124431953_9b436bc834_o.jpg" width=250&gt;&lt;/A&gt; 
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Using the data displayed by &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;netcflaunch.exe&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;, enter the IP address and port number in format &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;&amp;lt;IPAddress&amp;gt;&amp;lt;single space&amp;gt;&amp;lt;port number&amp;gt;&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; in the &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;Device&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; drop down in the RPM user interface.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Before connecting to the device, you must specify the application you'd like to monitor using the &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;Application&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; text box.&amp;nbsp; Be sure to type the fully qualified path name to the executable you wish to run on the device.&amp;nbsp; For example, &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;\Program Files\poomcominterop\poomcominterop.exe&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;.&amp;nbsp; If your applications takes command line parameters, you can specify them in the &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;Parameters&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; text box.&amp;nbsp; If you need to specify more than one parameter, be sure to separate them with a space.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;After you've selected the device to connect to, and specified the application to launch, click the &lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;Connect&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt; button in the lower right corner of RPM's user interface.&amp;nbsp; The RPM will send a command to the device to remotely launch the application and start pulling back performance statistics.&amp;nbsp; RPM displays the statistics in tabular form as shown in the following picture:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/stevenjpr/124431956/"&gt;&lt;IMG height=610 alt=TuneIn2 src="http://static.flickr.com/55/124431956_0e2a4e2041_o.jpg" width=812&gt;&lt;/A&gt; 
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Again, a description of the various counters can be found on &lt;A href="/davidklinems/archive/2005/12/09/502125.aspx"&gt;David Kline's blog&lt;/A&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;&lt;FONT face=Verdana&gt;Viewing Performance Statistics using Perfmon&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;While viewing performance statistics in RPM is useful, it's often easier to spot performance trends by viewing the data in a graphical form.&amp;nbsp; The RPM enables you to view the statistics graphically by sending all the data it collects to the Windows Performance Monitor.&amp;nbsp; After opening performance monitor, select the "&lt;/FONT&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;Add Counter&lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;" option.&amp;nbsp; In the dialog that is displayed you'll see counters corresponding to each category of performance statistic gathered by the RPM as show below:&lt;/FONT&gt;&lt;/P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/stevenjpr/124431957/"&gt;&lt;IMG height=455 alt=TuneIn3 src="http://static.flickr.com/38/124431957_952e9cf1b8_o.jpg" width=654&gt;&lt;/A&gt; 
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;After selecting the counters you'd like to view, the values for those counters appear as a line in the Perfmon graph.&amp;nbsp; You may need to adjust the scale Perfmon uses to display a counter depending on the expected range of values.&amp;nbsp; In the picture below I've chosen to view counters representing the size of the GC heap and the total number of bytes allocated while my application runs. &lt;/FONT&gt;&lt;/P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/stevenjpr/73548466/"&gt;&lt;IMG height=673 alt=GCHeap src="http://static.flickr.com/34/73548466_cb15c52ed7_o.jpg" width=800&gt;&lt;/A&gt; 
&lt;P&gt;&lt;B&gt;&lt;FONT face=Verdana&gt;Other RPM Features&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;In addition to viewing performance statistics, the RPM also allows you to set various configuration options for your device.&amp;nbsp; Selecting the Logging Options item from the Device menu displays the following dialog:&lt;/FONT&gt;&lt;/P&gt;&lt;A title="Photo Sharing" href="http://www.flickr.com/photos/stevenjpr/128038407/"&gt;&lt;IMG height=357 alt=TuneIn4 src="http://static.flickr.com/56/128038407_d2e829df04_o.jpg" width=464&gt;&lt;/A&gt; 
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;As you can see, the RPM allows you to configure the various types of logging done by the Compact Framework and to put your device into a state in which you can attach the debugger to any managed process.&amp;nbsp; The following links provide more information about the various logging options:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;&lt;B&gt;Loader logging:&lt;/B&gt; &lt;A href="/stevenpr/archive/2005/02/28/381744.aspx"&gt;http://blogs.msdn.com/stevenpr/archive/2005/02/28/381744.aspx&lt;/A&gt; &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;&lt;B&gt;Interop logging:&lt;/B&gt; &lt;A href="/stevenpr/archive/2005/06/22/431612.aspx"&gt;http://blogs.msdn.com/stevenpr/archive/2005/06/22/431612.aspx&lt;/A&gt; &lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Steven&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Rockwell size=2&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=577636" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevenpr/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>Diagnosing Marshaling Errors using Interop Logging</title><link>http://blogs.msdn.com/stevenpr/archive/2005/06/22/431612.aspx</link><pubDate>Wed, 22 Jun 2005 20:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:431612</guid><dc:creator>stevenpr</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/stevenpr/comments/431612.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevenpr/commentrss.aspx?PostID=431612</wfw:commentRss><description>&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;In a previous post I described how the Loader Log can be used to help diagnose problems such as assembly load failures, version mismatches and so on (&lt;/FONT&gt;&lt;a href="http://blogs.msdn.com/stevenpr/archive/2005/02/28/381744.aspx"&gt;&lt;FONT face=Verdana&gt;http://blogs.msdn.com/stevenpr/archive/2005/02/28/381744.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt; ).&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Another critical element of our new diagnostics feature set in Whidbey is Interop Logging.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;Interop logging was added in response to the huge number of questions and support calls we’ve seen over the last few years related to PInvoke.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;If you’ve used PInvoke to call a native function from your managed application, you’ve likely seen how easy it is to get the managed definition of your native function incorrect, leading the marshaling errors at runtime.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;In fact, the difficulty in matching native and managed definitions is a significant enough issue that an entire site now exists to help you get this right.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Check out &lt;/FONT&gt;&lt;A href="http://www.pinvoke.net/"&gt;&lt;FONT face=Verdana&gt;www.pinvoke.net&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt; for the managed definitions of many of the Win32 APIs.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Help with both WindowsCE and “desktop” definitions is available.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;In this post, I’ll show you how our new Interop logging feature makes it much easier to diagnose errors encountered when using PInvoke or COM interop to call native code from your .Net Compact Framework application.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;In many ways, Interop logging is the Compact Framework’s equivalent to the Interop Customer Debug Probe (aka Managed Debug Assistant) offered by the full .Net Framework (&lt;/FONT&gt;&lt;a href="http://blogs.msdn.com/adam_nathan/archive/2003/05/13/56680.aspx"&gt;&lt;FONT face=Verdana&gt;http://blogs.msdn.com/adam_nathan/archive/2003/05/13/56680.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt; ). &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H1&gt;&lt;FONT face=Verdana size=3&gt;Enabling the Interop Log&lt;/FONT&gt;&lt;/H1&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;Interop logging is enabled and configured by setting a series of registry keys.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;At a minimum, you must set two keys: one to enable the CLR’s overall logging feature and one to specifically enable interop logging.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;To enable CLR logging, set the following DWORD value to 1:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code&gt;&lt;SPAN&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Lucida Console"&gt;HKLM\Software\Microsoft\.NETCompactFramework\Diagnostics\Logging\Enabled&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;To specifically enable interop logging, the following DWORD value must be set to 1:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code&gt;&lt;SPAN&gt;&lt;FONT color=#000080&gt;&lt;FONT face="Lucida Console"&gt;HKLM\Software\Microsoft\.NETCompactFramework\Diagnostics\Logging\Interop\Enabled&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;When these two keys are set, the CLR will create a file named &lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT size=2&gt;&lt;SPAN class=CodeChar&gt;&lt;FONT face="Lucida Console" color=#000080&gt;netcf_Interop.log&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt; in the same directory as your application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;There are a few other values you can set to customize how the log file is named and how eagerly it is written to.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;If you saw my earlier post on Loader logging, these values should look familiar as they apply to all logging done by the Compact Framework.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;These values (all DWORDs) are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code&gt;&lt;FONT color=#000080&gt;&lt;SPAN&gt;&lt;SPAN&gt;·&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face="Lucida Console"&gt;HKLM\Software\Microsoft\.NETCompactFramework\Diagnostics\Logging\UseApp&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;The &lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT size=2&gt;&lt;SPAN class=CodeChar&gt;&lt;FONT face="Lucida Console" color=#000080&gt;UseApp&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt; value causes the name of the application to be included in the name of the log file.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;For example, if I’m running an application called &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=CodeChar&gt;&lt;FONT face="Lucida Console" color=#000080&gt;BankClient.exe&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;, setting the &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=CodeChar&gt;&lt;FONT face="Lucida Console" color=#000080&gt;UseApp&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt; value to 1 will cause the log file to be named &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=CodeChar&gt;&lt;FONT face="Lucida Console" color=#000080&gt;netcf_BankClient_Interop.log&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;. The &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=CodeChar&gt;&lt;FONT face="Lucida Console" color=#000080&gt;UseApp&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt; value is useful if you enable logging and have several applications installed in the same directory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code&gt;&lt;FONT color=#000080&gt;&lt;SPAN&gt;&lt;SPAN&gt;·&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face="Lucida Console"&gt;HKLM\Software\Microsoft\.NETCompactFramework\Diagnostics\Logging\UsePid&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;The &lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT size=2&gt;&lt;SPAN class=CodeChar&gt;&lt;FONT face="Lucida Console" color=#000080&gt;UsePid&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt; value causes the process’s ID to be included in the name of the log file.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;As with &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN class=CodeChar&gt;&lt;FONT face="Lucida Console" color=#000080&gt;UseApp&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;, the&lt;/FONT&gt;&lt;SPAN class=CodeChar&gt;&lt;FONT face="Lucida Console" color=#000080&gt; UsePid&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt; value is useful if you enable logging and have several applications installed in the same directory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code&gt;&lt;FONT color=#000080&gt;&lt;SPAN&gt;&lt;SPAN&gt;·&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;FONT face="Lucida Console"&gt;HKLM\Software\Microsoft\.NETCompactFramework\Diagnostics\Logging\Flush&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;FONT face=Verdana&gt;Setting the Flush value to 1 will cause the CLR to write log events to the log file as they occur instead of buffering them up.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Flushing eagerly negatively affects performance, but it can be useful in case you’re not getting the data you need in the log file because of application crashes or other errors.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H1&gt;&lt;FONT face=Verdana size=3&gt;What’s in the Interop Log?&lt;/FONT&gt;&lt;/H1&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;The Interop log contains two primary pieces of information:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT size=2&gt;·&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;The managed and native function signatures for all calls that cross an interop boundary.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;That is, both calls from managed code to native code and calls from native back into managed.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT size=2&gt;·&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Verdana size=2&gt;Errors returned to native callers from managed code.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;This category of logging is particularly useful when diagnosing errors you get when calling a managed object from native code using Com Interop.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;In addition to these two general categories of information, the Interop log also contains data about scenarios the Compact Framework doesn’t support which would otherwise be very hard to diagnose.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;For example, interfaces implemented in managed code cannot be called from Com if the interface contains any generic methods.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Trying to call methods on such an interface will generate error text in the Interop log.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;The Interop log contains three lines for every call that uses either Pinvoke or Com Interop.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Here’s an example:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;[pinvokeimpl][preservesig]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;int&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Sample.Form1:: NativeFunction (int , string);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;int (I4_VAL) NativeFunction (int (I4_VAL) , WCHAR * (STRING_LPWSTR) );&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;The first line is a set of flags that describes the call.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;In the example above, the &lt;/FONT&gt;&lt;SPAN&gt;[pinvokeimpl]&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; flag indicates that this call is a PInvoke.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;A value of &lt;/FONT&gt;&lt;SPAN&gt;[delegate]&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; indicates a call from native code to managed code through a delegate that was marshaled to native code as a pointer to a function.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;The absence of a value altogether signifies a call through Com Interop.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;The second line is the managed definition of the native function being called.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;In this case, you can see that the native function was declared in managed code as taking two parameters, an int and a string, and returning an int.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;The third line is the native definition of the function as understood by the Compact Framework.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;In this case, we can see that the managed string argument is being marshaled to native code as a pointer to a Unicode string, for example.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;For calls that include error information, the text describing the error, including the error value is written either just before or just after the call information.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2&gt;&lt;FONT face=Verdana size=2&gt;Diagnosing Marshaling Errors&lt;/FONT&gt;&lt;/H2&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;The native function signature (the 3&lt;SUP&gt;rd&lt;/SUP&gt; line from our description above) is the most useful when diagnosing marshaling errors that occur when you are calling native code either through PInvoke or Com Interop.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;The Compact Framework does not have intrinsic knowledge of the native function you are calling – it simply takes the managed definition you’ve provided and creates an equivalent native signature.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;If this signature doesn’t match the actual signature of the targeted native function, a marshaling error will occur.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;These errors are fixed by changing your managed definition to match the actual native function signature.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;Here’s an example.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Let’s assume we’re using PInvoke to call a native function with the following signature (in C):&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;int NativeFunction(long value);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;In managed code, we declare &lt;/FONT&gt;&lt;SPAN&gt;NativeFunction&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; as follows:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;[DllImport("Sample.dll")]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;static extern int NativeFunction(long value);&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;Calling &lt;/FONT&gt;&lt;SPAN&gt;NativeFunction&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; from managed code, gives us the following entries in the Interop log:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;[pinvokeimpl][preservesig]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;int&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Sample.Form1:: NativeFunction (long);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;int (I4_VAL) NativeFunction (INT64 (I8_VAL) );&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;Can you see the marshaling error?&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;The C definition of &lt;/FONT&gt;&lt;SPAN&gt;NativeFunction&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; takes a single &lt;/FONT&gt;&lt;SPAN&gt;long&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; as a parameter.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Variables of type &lt;/FONT&gt;&lt;SPAN&gt;long&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; is C/C++ are 32 bits (I’m on x86).&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;However, the &lt;/FONT&gt;&lt;SPAN&gt;long&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; type in C# is 64 bits.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;By looking at the 3&lt;SUP&gt;rd&lt;/SUP&gt; line of our Interop log, we can see that the .Net Compact Framework is marshaling the &lt;/FONT&gt;&lt;SPAN&gt;long&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; parameter as a 64 bit value, when the native function is expecting only a 32 bit value.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;In this case, an extra 4 bytes will be pushed on the stack as the call is made.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;Fixing this problem involves defining the parameter to &lt;/FONT&gt;&lt;SPAN&gt;NativeFunction&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; as an &lt;/FONT&gt;&lt;SPAN&gt;int&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; in managed code like so:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;[DllImport("Sample.dll")]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;static extern int NativeFunction(int value);&lt;/SPAN&gt;&lt;SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;Now everything lines up at call time according to the interop log:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;[pinvokeimpl][preservesig]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;int&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Sample.Form1:: NativeFunction (long);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;int (I4_VAL) NativeFunction (int (I4_VAL) );&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;Even with this simple example it’s easy to see how easy it is to make mistakes when writing the managed definitions of unmanaged functions.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;These problems are easier to diagnose now that the interop log tells you exactly how the data is being marshaled.&lt;/FONT&gt;&lt;/P&gt;
&lt;H2&gt;&lt;FONT face=Verdana size=2&gt;COM Error Information&lt;/FONT&gt;&lt;/H2&gt;
&lt;P class=MsoNormal&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;As described, the other major purpose of the Interop log is to help diagnose errors returned from calls made through COM interop.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;This is particularly useful when calling from native code into managed code mostly because the Compact Framework implements several COM interfaces on your object’s behalf.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;The following log entries show the result of a failed called to &lt;/FONT&gt;&lt;SPAN&gt;QueryInterface&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; on a managed object.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;As you can see, the log includes the GUID of the interface that the Compact Framework couldn’t return.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;[no flags] &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;void&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;BankObjectsLib.IAccount::Withdraw(BankObjectsLib.IAccount , int );&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;HRESULT Withdraw(IAccount *(INTF_VAL) this, int (I4_VAL) );&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;ERROR: CCW IUnknown::QueryInterface Error: 0x80004002 {06FAF1B7-66B8-4FFC-9396-A0FD3C01E75C}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;This case is perhaps oversimplified if you own the native code that is making the call.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;In that case, you presumably know which interface you are querying for can just check the &lt;SPAN&gt;HRESULT&lt;/SPAN&gt; in code.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;However, this logging really pays off in situations where you are using a COM object or ActiveX control that you don’t own.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;In scenarios like this, it’s not uncommon to find the object querying for interfaces or using other COM features that you didn’t expect.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;Logging information about COM errors also helps you in case you attempt to use a feature that the Compact Framework doesn’t support.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;For example, we don’t support the ability to get type information by calling &lt;/FONT&gt;&lt;SPAN&gt;IDispatch::GetTypeInfo&lt;/SPAN&gt;&lt;FONT face=Verdana&gt;.&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Attempts to use &lt;/FONT&gt;&lt;SPAN&gt;GetTypeInfo&lt;/SPAN&gt;&lt;FONT face=Verdana&gt; will be clearly displayed in the Interop log.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;By the way, I’m currently gathering a list of all such unsupported features and hope to post it soon.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;Comment or email with questions as always.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;Steven&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=431612" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevenpr/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/stevenpr/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>Better Diagnostics in Whidbey: Loader Logging</title><link>http://blogs.msdn.com/stevenpr/archive/2005/02/28/381744.aspx</link><pubDate>Mon, 28 Feb 2005 18:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:381744</guid><dc:creator>stevenpr</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/stevenpr/comments/381744.aspx</comments><wfw:commentRss>http://blogs.msdn.com/stevenpr/commentrss.aspx?PostID=381744</wfw:commentRss><description>&lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;If you’ve spent much time developing applications with version 1 of the .Net Compact Framework, you’ve likely been frustrated at times by the lack of tools to help you diagnose problems in your applications.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Even common errors, like the failure to find an assembly are hard to diagnose, much less more complex problems like memory leaks or performance issues.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Admittedly, the lack of a good diagnostics infrastructure in version 1 of our product has been one of the greatest sources of customer frustration and support cost.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Fortunately, we’ve listened to the feedback and have invested a significant amount of time and resources in version 2 to help the situation.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Some of the new features you’ll find in version 2 that make it easier to understand what’s going on in a running application include:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul style="MARGIN-TOP: 0in" type="disc"&gt; &lt;li class="MsoNormal" style="MARGIN: 6pt 0in; mso-list: l3 level1 lfo1; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;Stack traces for all exceptions,&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="MARGIN: 6pt 0in; mso-list: l3 level1 lfo1; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;Descriptive error messages for “common” exceptions, such as the failure to load a type, failure to find a PInvoke DLL and so on,&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="MARGIN: 6pt 0in; mso-list: l3 level1 lfo1; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;More performance counters (see &lt;/font&gt;&lt;A href="http://blogs.msdn.com/scottholden/archive/2004/12/28/339007.aspx"&gt;&lt;font face="Verdana"&gt;http://blogs.msdn.com/scottholden/archive/2004/12/28/339007.aspx&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana"&gt; &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;),&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="MARGIN: 6pt 0in; mso-list: l3 level1 lfo1; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;Remote performance monitoring (see &lt;/font&gt;&lt;A href="http://blogs.msdn.com/scottholden/archive/2004/12/27/332998.aspx"&gt;&lt;font face="Verdana"&gt;http://blogs.msdn.com/scottholden/archive/2004/12/27/332998.aspx&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana"&gt; ),&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="MARGIN: 6pt 0in; mso-list: l3 level1 lfo1; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;Logs for understanding how types are marshaled between managed and native code (and vice versa),&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="MARGIN: 6pt 0in; mso-list: l3 level1 lfo1; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;Logs for network traffic, and&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="MARGIN: 6pt 0in; mso-list: l3 level1 lfo1; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;Loader logging.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;In this post, I’m going to focus on how the new loader logging feature can help you diagnose failures encountered by the CLR’s class loader.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;As we’ll see, loader logging helps you determine why assemblies couldn’t be loaded, why types couldn’t be found and so on.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;It also provides information about the version of .Net CF used to run your application and whether or not your application is being run in “compatibility mode” (see &lt;/font&gt;&lt;A href="http://blogs.msdn.com/stevenpr/archive/2004/12/30/344540.aspx"&gt;&lt;font face="Verdana"&gt;http://blogs.msdn.com/stevenpr/archive/2004/12/30/344540.aspx&lt;/font&gt;&lt;/a&gt;&lt;font face="Verdana"&gt; for background on our approach to application compatibility).&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;h1 style="MARGIN: 0.25in 0in 6pt"&gt;&lt;font face="Verdana" size="3"&gt;Enabling the Loader Log&lt;/font&gt;&lt;/h1&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;Loader logging is enabled and configured by setting a series of registry keys.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;At a minimum, you must set two keys: one to enable the CLR’s overall logging feature and one to specifically enable loader logging.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;To enable CLR logging, set the following DWORD value to 1:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in 8pt 0.25in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font color="#000080"&gt;&lt;font face="Lucida Console"&gt;HKLM\Software\Microsoft\.NETCompactFramework\Diagnostics\Logging\Enabled&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;To specifically enable loader logging, the following DWORD value must be set to 1:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in 8pt 0.25in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font color="#000080"&gt;&lt;font face="Lucida Console"&gt;HKLM\Software\Microsoft\.NETCompactFramework\Diagnostics\Logging\Loader\Enabled&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;When these two keys are set, the CLR will create a file named &lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;netcf_loader.log&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt; in the same directory as your application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;There are a few other values you can set to customize how the log file is named and how eagerly it is written to.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;These values (all DWORDs) are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in 8pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo4; tab-stops: 16.2pt .45in list .5in left 48.6pt .9in 81.0pt 1.35in 113.4pt 1.8in 145.8pt 2.25in 178.2pt 2.7in"&gt;&lt;font color="#000080"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Lucida Console"&gt;HKLM\Software\Microsoft\.NETCompactFramework\Diagnostics\Logging\UseApp&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 16.2pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;The &lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;UseApp&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt; value causes the name of the application to be included in the name of the log file.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;For example, if I’m running an application called &lt;/font&gt;&lt;/span&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;VW.exe&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;, setting the &lt;/font&gt;&lt;/span&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;UseApp&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt; value to 1 will cause the log file to be named &lt;/font&gt;&lt;/span&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;netcf_VW_loader.log&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;. The &lt;/font&gt;&lt;/span&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;UseApp&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt; value is useful if you enable loader logging and have several applications installed in the same directory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 16.2pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&lt;font face="Verdana"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in 8pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l4 level1 lfo3; tab-stops: 16.2pt .45in list .5in left 48.6pt .9in 81.0pt 1.35in 113.4pt 1.8in 145.8pt 2.25in 178.2pt 2.7in"&gt;&lt;font color="#000080"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Lucida Console"&gt;HKLM\Software\Microsoft\.NETCompactFramework\Diagnostics\Logging\UsePid&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 16.2pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;The &lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;UsePid&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt; value causes the process’s ID to be included in the name of the log file.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;As with &lt;/font&gt;&lt;/span&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;UseApp&lt;/font&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;, the&lt;/font&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt; UsePid&lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt; value is useful if you enable loader logging and have several applications installed in the same directory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 16.2pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&lt;font face="Verdana"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in 8pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo2; tab-stops: 16.2pt .45in list .5in left 48.6pt .9in 81.0pt 1.35in 113.4pt 1.8in 145.8pt 2.25in 178.2pt 2.7in"&gt;&lt;font color="#000080"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;·&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Lucida Console"&gt;HKLM\Software\Microsoft\.NETCompactFramework\Diagnostics\Logging\Flush&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 16.2pt"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;Setting the Flush value to 1 will cause the CLR to write log events to the log file as they occur instead of buffering them up.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Flushing eagerly negatively affects performance, but it can be useful in case you’re not getting the data you need in the log file because of application crashes or other errors.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;h1 style="MARGIN: 0.25in 0in 6pt"&gt;&lt;font face="Verdana" size="3"&gt;What’s in the Loader Log?&lt;/font&gt;&lt;/h1&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;Now that we’ve seen how to enable loader logging, let’s take a look at the type of information the CLR’s class loader writes to the log files.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Loader logs consist of two sections:&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;a header and a body.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;The header of the log file contains the following data:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;ul style="MARGIN-TOP: 0in" type="disc"&gt; &lt;li class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l1 level1 lfo2; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;The name of the application’s main executable&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l1 level1 lfo2; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;The process ID as assigned by the operating system&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l1 level1 lfo2; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;The date and time the log file was created&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l1 level1 lfo2; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;The version of .Net CF used to run the application&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt; &lt;li class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-list: l1 level1 lfo2; tab-stops: list .5in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;Information about the platform on which your application is running&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;The data in the body of the log file includes descriptive information about each assembly as it is loaded, as well as diagnostic data to help you find errors encountered by the class loader as your application is executed.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Specifically, the body of the log file contains:&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo5; tab-stops: list .5in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;The “coercion” state.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;That is, whether or not your application was run in backwards compatibility mode.&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo5; tab-stops: list .5in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Tracing for each assembly load, including where the assembly was loaded from and which version was loaded.&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo5; tab-stops: list .5in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;The trust level assigned to each module as it is loaded&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo5; tab-stops: list .5in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Whether or not the CLR found a configuration file associated with your application&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo5; tab-stops: list .5in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Failures to find methods, types, assemblies and modules.&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l2 level1 lfo5; tab-stops: list .5in"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="2"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Verdana" size="2"&gt;Failures to find a PInvoke DLL or a function within a PInvoke DLL&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;o:p&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Here’s a sample log file from the run of an application that encountered no errors (I’ve added the line numbers for the line-by-line summary that follows the sample).&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This sample gives us a good chance to get a general idea of the type of information logged by the CLR class loader:&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;font color="#000080"&gt;&lt;font face="Lucida Console"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;========================================&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;1 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Process&lt;span style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[\Program Files\VW\VW.exe]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;2 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; ProcessID&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[0x4d9585d2]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;3 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Date&lt;span style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[2005/02/25] (yyyy/mm/dd)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;4 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Time&lt;span style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[18:33:14] (hh:mm:ss)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;5 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; NETCF&lt;span style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;[2.0.5035.00]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;6 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Platform&lt;span style="mso-tab-count: 1"&gt; &lt;/span&gt;[Windows CE v4.20.1081 (PocketPC) WinCE4ARMV4 release Beta2 ARMV4 IJITv2]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;font color="#000080"&gt;&lt;font face="Lucida Console"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;========================================&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;7 |&lt;/span&gt;&lt;font color="#000080"&gt;&lt;font face="Lucida Console"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Compatibility mode [0.0.0.0]&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;8 |&lt;/span&gt;&lt;font color="#000080"&gt;&lt;font face="Lucida Console"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Loading module [\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;9 |&lt;/span&gt;&lt;font color="#000080"&gt;&lt;font face="Lucida Console"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Loaded [mscorlib, Version=2.0.0.0, Culture=neutral, &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;PublicKeyToken=969DB8053D3322AC] from [\Windows\GAC_mscorlib_v2_0_0_0_cneutral_1.dll]&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;10 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Loading module [\Program Files\VW\VW.exe]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;11 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Policy file not present. [\Program Files\VW\VW.exe.config]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;12 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Loading module [\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;13 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Loaded [System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC] from [\Windows\GAC_System.Windows.Forms_v2_0_0_0_cneutral_1.dll]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;14 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Loading module [\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;15 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Loaded [System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC] from [\Windows\GAC_System_v2_0_0_0_cneutral_1.dll]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;16 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Loading module [\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;17 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Loaded [System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC] from [\Windows\GAC_System.Drawing_v2_0_0_0_cneutral_1.dll]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;18 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Loading module [\Program Files\VW\Cars.dll]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;19 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Failed to load [Cars, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null] from GAC&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;20 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Loaded [Cars, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null] from [\Program Files\VW\Cars.dll]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;21 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Loading module [\Windows\GAC_SUVs_v10_0_0_0_cneutral_1.dll]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font size="2"&gt;&lt;span style="COLOR: windowtext; FONT-FAMILY: Verdana"&gt;22 |&lt;/span&gt;&lt;font face="Lucida Console" color="#000080"&gt; Loaded [SUVs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=1EF9E65A8D4F2CD6] from [\Windows\GAC_SUVs_v10_0_0_0_cneutral_1.dll]&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in"&gt;&lt;font face="Lucida Console" color="#000080" size="2"&gt;==================(end)=================&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;o:p&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Lines 1-6&lt;/b&gt; are the header of the loader log.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Line 7&lt;/b&gt; states that the application is not being run in compatibility mode.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;If this application were built with .Net CF version 1.0 and was run by .Net CF version 2.0, the version number displayed in line 7 would be 1.0.0.0.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Again, refer to &lt;span style="FONT-SIZE: 10pt"&gt;&lt;A href="http://blogs.msdn.com/stevenpr/archive/2004/12/30/344540.aspx"&gt;http://blogs.msdn.com/stevenpr/archive/2004/12/30/344540.aspx&lt;/a&gt;&lt;/span&gt; for a description of how compatibility mode works in .Net CF 2.0.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Lines 8 and 9&lt;/b&gt; show the CLR loading the mscorlib assembly.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;As you can infer from this trace, the CLR loads mscorlib before loading any other assemblies.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The loader log has (at least) two lines for every assembly that is loaded while the application is running.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;These two lines describe identity of the assembly the CLR is looking for and the location from which that assembly was loaded.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Line 10&lt;/b&gt; shows the name of the module containing the application’s main executable.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Line 11&lt;/b&gt; states that the CLR could not find a configuration file for this application.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Lines 12 and 13&lt;/b&gt; show the CLR loading the &lt;/font&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;System.Windows.Forms&lt;/font&gt;&lt;/span&gt;&lt;font face="Verdana"&gt; assembly from the GAC.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Lines 14 and 15&lt;/b&gt; show the CLR loading the &lt;/font&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;System&lt;/font&gt;&lt;/span&gt;&lt;font face="Verdana"&gt; assembly from the GAC.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Lines 16 and 17&lt;/b&gt; show the CLR loading the &lt;/font&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;System.Drawing&lt;/font&gt;&lt;/span&gt;&lt;font face="Verdana"&gt; assembly from the GAC.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Lines 18, 19 and 20 &lt;/b&gt;show the CLR loading an application assembly called &lt;/font&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;Cars&lt;/font&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;In this case, the log shows that the CLR loaded &lt;/font&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;Cars&lt;/font&gt;&lt;/span&gt;&lt;font face="Verdana"&gt; out of the application directory after failing to find it in the GAC.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;By the way, searching the GAC is extraneous in this case because &lt;/font&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;Cars&lt;/font&gt;&lt;/span&gt;&lt;font face="Verdana"&gt; is not strongly named.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in 6pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font face="Verdana"&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Lines 21 and 22&lt;/b&gt; show the CLR loading an application assembly called &lt;/font&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;SUVs&lt;/font&gt;&lt;/span&gt;&lt;font face="Verdana"&gt;.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;As the log shows, the CLR found &lt;/font&gt;&lt;span class="CodeChar"&gt;&lt;font face="Lucida Console" color="#000080"&gt;SUVs&lt;/font&gt;&lt;/span&gt;&lt;font face="Verdana"&gt; in the GAC.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;o:p&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;As described, the primary goal of the loader log is to help you diagnose failures that occur while running your application.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;The following two examples show how the loader log makes it easy for you to figure out what’s happening when errors are encountered.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This first example shows the log entries that are written when the loader fails to find an assembly:&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in; TEXT-INDENT: 0.25in"&gt;&lt;font size="2"&gt;&lt;font color="#000080"&gt;&lt;font face="Lucida Console"&gt;Loading module [\Program Files\VW\Golf.dll]&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in; TEXT-INDENT: 0.25in"&gt;&lt;font face="Lucida Console" color="#000080" size="2"&gt;Attempt to load [\Program Files\VW\Golf.dll] has failed (err 0x80001000).&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in; TEXT-INDENT: 0.25in"&gt;&lt;font size="2"&gt;&lt;font color="#000080"&gt;&lt;font face="Lucida Console"&gt;Loading module [\Program Files\VW\Golf.exe]&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in; TEXT-INDENT: 0.25in"&gt;&lt;font size="2"&gt;&lt;font color="#000080"&gt;&lt;font face="Lucida Console"&gt;Attempt to load [\Program Files\VW\Golf.exe] has failed (err 0x80001000).&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in; TEXT-INDENT: 0.25in"&gt;&lt;font face="Lucida Console" color="#000080" size="2"&gt;Failed to load [Golf, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;As you can see, the loader logs the identity of the assembly it is looking for, along with the names of the files and locations it probed while looking for the assembly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;This example shows the log entries that are written when the loader fails to find a specific type:&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in 8pt 0.25in"&gt;&lt;font size="2"&gt;&lt;font color="#000080"&gt;&lt;font face="Lucida Console"&gt;Missing Type. Type [Cars.Jetta], Assembly [Cars].&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="Code" style="MARGIN: 8pt 0in 8pt 0.25in"&gt;&lt;font face="Lucida Console" color="#000080" size="2"&gt;Missing Type. Class [Cars.Jetta], Assembly [Cars, Version=5.0.0.0, Culture=neutral, PublicKeyToken=null].&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;span style="FONT-SIZE: 10pt"&gt;&lt;font face="Verdana"&gt;As expected, the CLR logs the name of the type it couldn’t find along with the assembly in which it expected the type to be found.&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;o:p&gt;&lt;font face="Verdana" size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;We hope that the data provided in the loader log will make it much easier to help debug applications running on .Net CF 2.0.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;As described, the loader log is just one of the many new debugging tools we’re providing in Whidbey.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;As always, feedback is appreciated.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;If there are specific loader-related errors you repeatedly see that we’re not logging, be sure and let us know.&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Thanks,&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;font face="Verdana" size="2"&gt;Steven&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 6pt 0in"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #333300; FONT-FAMILY: Verdana"&gt;This posting is provided "AS IS" with no warranties, and confers no rights.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=381744" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/stevenpr/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item></channel></rss>