<?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>David Kline : Diagnostics</title><link>http://blogs.msdn.com/davidklinems/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>.NET Compact Framework v3.5 Power Toys Released!</title><link>http://blogs.msdn.com/davidklinems/archive/2007/12/19/net-compact-framework-v3-5-power-toys-released.aspx</link><pubDate>Thu, 20 Dec 2007 07:05:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6813050</guid><dc:creator>DavidKlineMS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/davidklinems/comments/6813050.aspx</comments><wfw:commentRss>http://blogs.msdn.com/davidklinems/commentrss.aspx?PostID=6813050</wfw:commentRss><description>&lt;p&gt;I've been meaning to post this for the last week...&amp;#160; &lt;br /&gt;    &lt;br /&gt;The .NET Compact Framework v3.5 Power Toys have officially been released.&amp;#160; You can download the Power Toys from &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=C8174C14-A27D-4148-BF01-86C2E0953EAB&amp;amp;displaylang=en"&gt;here&lt;/a&gt;.     &lt;br /&gt;    &lt;br /&gt;See the &lt;a href="http://blogs.msdn.com/netcfteam"&gt;.NET Compact Framework Team&lt;/a&gt; weblog for &lt;a href="http://blogs.msdn.com/netcfteam/archive/2007/12/13/power-toys-for-net-compact-framework-3-5-have-been-released.aspx"&gt;details&lt;/a&gt; on the included tools.     &lt;br /&gt;    &lt;br /&gt;Enjoy!     &lt;br /&gt;-- DK     &lt;br /&gt;&lt;font size="1"&gt;     &lt;br /&gt;Disclaimer(s):       &lt;br /&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=6813050" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>CoreCon API: Brought to you by the Visual Studio for Devices team</title><link>http://blogs.msdn.com/davidklinems/archive/2007/12/07/corecon-api-brought-to-you-by-the-visual-studio-for-devices-team.aspx</link><pubDate>Sat, 08 Dec 2007 00:42:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6697316</guid><dc:creator>DavidKlineMS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/davidklinems/comments/6697316.aspx</comments><wfw:commentRss>http://blogs.msdn.com/davidklinems/commentrss.aspx?PostID=6697316</wfw:commentRss><description>&lt;p&gt;The Visual Studio for Devices team has been posting a very interesting and informative series on the CoreCon API.&amp;#160; I highly encourage anyone interested in writing remote tools to read the series.&amp;#160; In fact, I recommend everyone interested in developing applications and/or tools for devices to subscribe to their RSS feed.    &lt;br /&gt;    &lt;br /&gt;As of this posting, there are five installments to the series:     &lt;br /&gt;&lt;a href="http://blogs.msdn.com/vsdteam/archive/2007/11/20/corecon-api-part-1.aspx"&gt;Part I&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://blogs.msdn.com/vsdteam/archive/2007/11/20/corecon-api-part-ii.aspx"&gt;Part II&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://blogs.msdn.com/vsdteam/archive/2007/11/21/corecon-api-part-iii.aspx"&gt;Part III&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://blogs.msdn.com/vsdteam/archive/2007/12/03/part-iv.aspx"&gt;Part IV&lt;/a&gt;     &lt;br /&gt;&lt;a href="http://blogs.msdn.com/vsdteam/archive/2007/12/06/corecon-api-part-v.aspx"&gt;Part V&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;Enjoy!     &lt;br /&gt;-- DK     &lt;br /&gt;    &lt;br /&gt;&lt;font size="1"&gt;Disclaimer(s):      &lt;br /&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=6697316" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>Steven Pratschner on the CLR Profiler for the .NET Compact Framework</title><link>http://blogs.msdn.com/davidklinems/archive/2007/11/28/steven-pratschner-on-the-clr-profiler-for-the-net-compact-framework.aspx</link><pubDate>Thu, 29 Nov 2007 03:16:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6587713</guid><dc:creator>DavidKlineMS</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/davidklinems/comments/6587713.aspx</comments><wfw:commentRss>http://blogs.msdn.com/davidklinems/commentrss.aspx?PostID=6587713</wfw:commentRss><description>&lt;p&gt;I love tools.&amp;#160; &lt;a href="http://blogs.msdn.com/davidklinems/archive/tags/Debugging/default.aspx"&gt;Debuggers&lt;/a&gt;, analyzers, performance monitors, profilers, everything.&amp;#160; In version 1 of the .NET Compact Framework, the only available tools where the Visual Studio debugger and the &lt;a href="http://blogs.msdn.com/davidklinems/archive/2005/12/09/502125.aspx"&gt;performance counter&lt;/a&gt; data file (also known as the app.stats file).&amp;#160; Version 2 added diagnostic logs and in Service Pack 1, the &lt;a href="http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx"&gt;Remote Performance Monitor&lt;/a&gt;.     &lt;br /&gt;    &lt;br /&gt;&lt;a href="http://blogs.msdn.com/davidklinems/archive/2007/09/13/net-compact-framework-v3-5-power-toys-ctp.aspx"&gt;Version 3.5's power toys&lt;/a&gt; adds one of the most asked for tools - the CLR Profiler.&amp;#160; This is a very cool tool that enables developers to drill into the allocations made by their applications: what object types, how many of them, what methods are creating them, etc.&amp;#160; With the volume of the data the CLR Profiler provides, it can sometimes be hard to know where to begin.&amp;#160; &lt;br /&gt;    &lt;br /&gt;To our rescue comes &lt;a href="http://blogs.msdn.com/stevenpr"&gt;Steven Pratschner&lt;/a&gt; and his series on the CLR Profiler for the .NET Compact Framework.&amp;#160; He's up to three installments and I highly encourage anyone interested in application performance and memory usage to read them.&amp;#160; I'm currently devouring them and learning quite a bit.     &lt;br /&gt;    &lt;br /&gt;&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: Getting Started&lt;/a&gt;     &lt;br /&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: Histograms and &amp;quot;Show who Allocated&amp;quot;&lt;/a&gt;     &lt;br /&gt;&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: The Timeline View&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;Enjoy!     &lt;br /&gt;-- DK     &lt;br /&gt;    &lt;br /&gt;&lt;font size="1"&gt;Disclaimer(s):      &lt;br /&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=6587713" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>.NET Compact Framework v3.5 Power Toys CTP</title><link>http://blogs.msdn.com/davidklinems/archive/2007/09/13/net-compact-framework-v3-5-power-toys-ctp.aspx</link><pubDate>Thu, 13 Sep 2007 20:59:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4897422</guid><dc:creator>DavidKlineMS</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/davidklinems/comments/4897422.aspx</comments><wfw:commentRss>http://blogs.msdn.com/davidklinems/commentrss.aspx?PostID=4897422</wfw:commentRss><description>&lt;p&gt;The .NET Compact Framework team made an exciting CTP available this week.&amp;#xA0; 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 v3.5 Power Toys September 2007 CTP&lt;/a&gt; release contains some old friends (ex: Remote Performance Monitor) and ads some great new ones (Service Model Metadata Tool, App Configuration Tool, etc).     &lt;br /&gt;    &lt;br /&gt;Here's what the download page has to say about the included tools:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="1" width="75%" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="398"&gt;&lt;strong&gt;Remote Performance Monitor and GC Heap Viewer&lt;/strong&gt; &amp;#x2013; Provides real time counter data (ranging from Garbage Collector activity to type loading info) on a running NETCF application. The GC Heap Viewer feature allows you to capture the managed heap at any moment your app is running to view live references, and allows you to compare multiple snapshots to find memory leak issues.           &lt;br /&gt;          &lt;br /&gt;&lt;b&gt;NETCF CLR Profiler&lt;/b&gt; &amp;#x2013; CLR Profiler is an instrumenting allocation profiler for NETCF applications. It provides detailed allocation visualizations, allocation callstacks visualizations and useful for diagnosing memory management issues.           &lt;br /&gt;          &lt;br /&gt;&lt;b&gt;App Configuration Tool (NetCFcfg.exe)&lt;/b&gt; - On-device tool for specifying what version of the NETCF runtime an application will run against, displaying installed versions of NETCF and displaying info about DLLs in the GAC.           &lt;br /&gt;          &lt;br /&gt;&lt;b&gt;NETCF ServiceModel Metadata Tool&lt;/b&gt; &amp;#x2013; The .NET Compact Framework ServiceModel Metadata Tool (netcfsvcutil.exe) allows you to generate a Windows Communication Foundation (WCF) client proxy to help developers consume WCF services on device. Like svcutil.exe, which is the desktop version of the utility, netcfsvcutil.exe is a command-line tool that generates service model code from metadata documents and generates metadata documents from service model code.           &lt;br /&gt;          &lt;br /&gt;&lt;b&gt;Remote Logging Configuration Tool&lt;/b&gt; &amp;#x2013; The Logging Configuration Tool enables users to easily configure logging options on a NETCF device including: loader, interop, network, error and finalizer logs.           &lt;br /&gt;          &lt;br /&gt;&lt;b&gt;NETCF Network Log Viewer&lt;/b&gt; &amp;#x2013; A utility for viewing NETCF network log data. &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;   &lt;br /&gt;&lt;a href="http://blogs.msdn.com/danhorbatt/"&gt;Dan Horbatt&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/andrewarnottms/"&gt;Andrew Arnott&lt;/a&gt; talk in detail about the new Service Model Metadata Tool &lt;a href="http://blogs.msdn.com/danhorbatt/archive/2007/09/12/using-compact-svcutil-to-interact-with-servicecontracts.aspx"&gt;here&lt;/a&gt; (Dan) and &lt;a href="http://blogs.msdn.com/andrewarnottms/archive/2007/09/13/calling-wcf-services-from-netcf-3-5-using-compact-wcf-and-netcfsvcutil-exe.aspx"&gt;here&lt;/a&gt; (Andrew).     &lt;br /&gt;    &lt;br /&gt;I highly recommend downloading and using the power toys.&amp;#xA0; And as always, please send us your &lt;a href="http://connect.microsoft.com/visualstudio/feedback"&gt;feedback&lt;/a&gt;.     &lt;br /&gt;    &lt;br /&gt;Enjoy!     &lt;br /&gt;-- DK     &lt;br /&gt;    &lt;br /&gt;&lt;font face="Arial" size="1"&gt;Disclaimer(s):      &lt;br /&gt;This posting is provided &amp;quot;AS IS&amp;quot; with no warranties, and confers no rights.       &lt;br /&gt;The information contained within this post is in relation to beta software.&amp;#xA0; Any and all details are subject to change.&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4897422" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Announcements/default.aspx">Announcements</category><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Performance/default.aspx">Performance</category><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>Using the .NET Compact Framework Remote Performance Monitor to Configure Diagnostic Options</title><link>http://blogs.msdn.com/davidklinems/archive/2006/08/31/734123.aspx</link><pubDate>Thu, 31 Aug 2006 23:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:734123</guid><dc:creator>DavidKlineMS</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/davidklinems/comments/734123.aspx</comments><wfw:commentRss>http://blogs.msdn.com/davidklinems/commentrss.aspx?PostID=734123</wfw:commentRss><description>Diagnostic, performance and debugging tools are very cool.&amp;nbsp; The more tools available, the easier it tends to be to find and fix application issues.&amp;nbsp; With Visual Studio 2005, several handy tools were added.&amp;nbsp; I use the Remote Registry Editor and Remote File Viewer just about every day.&amp;nbsp; Version 2 of the .NET Compact Framework added diagnostic logs (enabled via the device registry) to help identify application problems in places where it was very difficult, or not possible to find them with other tools.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;One difficulty with using the diagnostic logs is setting the registry options.&amp;nbsp; Modifying the registry can be intimidating and, if done incorrectly, a risky proposition.&amp;nbsp; Readers familiar with my writings on using the diagnostic logs will recall that every time I mention the Remote Registry Editor, I include a warning to use the tool with great care.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;A few months ago, &lt;A href="http://blogs.msdn.com/stevenpr"&gt;Steven&lt;/A&gt; posted a tour of the &lt;A href="http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx"&gt;.NET Compact Framework Remote Performance Monitor&lt;/A&gt;.&amp;nbsp; He talked about installation, getting connected, publishing the statistics to the Windows Performance Monitor and touched upon what I am going to talk about today.&lt;BR&gt;&lt;BR&gt;Did you know that you can use the .NET Compact Framework Remote Performance Monitor to configure diagnostic options on a device?&lt;BR&gt;&lt;BR&gt;The other day, I was writing about &lt;A href="http://blogs.msdn.com/davidklinems/archive/2006/08/25/724718.aspx"&gt;using the MDbg command line debugger to attach to a .NET Compact Framework application&lt;/A&gt; and I needed to enable attach to process support.&amp;nbsp; On my way to the Start menu to run the Remote Registry Editor, I noticed that I had the .NET Compact Framework Remote Performance Monitor running and remembered that it could configure the device registry for me.&amp;nbsp; Having had the experience of&lt;A href="http://blogs.msdn.com/davidklinems/archive/2006/06/16/634503.aspx"&gt; incorrectly modifying this very registry flag while presenting at MEDC&lt;/A&gt;, I decided to save myself the embarrassment of making the same mistake again.&lt;BR&gt;&lt;BR&gt;On the Device menu of the .NET Compact Framework Remote Performance Monitor,&amp;nbsp;select&amp;nbsp;Logging Options.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/photos/davidklinems/picture734104.aspx" target=_blank&gt;&lt;IMG src="http://blogs.msdn.com/photos/davidklinems/images/734104/464x358.aspx" border=0&gt;&lt;/A&gt;&lt;BR&gt;&lt;BR&gt;The first step that is required is to connect to your device.&amp;nbsp; The steps to connect here are the same as those &lt;A href="http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx"&gt;Steven describes to connect to the performance statistics&lt;/A&gt;.&amp;nbsp; Once connected, you can configure your desired diagnostic settings.&lt;BR&gt;&lt;BR&gt;Once connected, you can 
&lt;P&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Enable the &lt;A href="http://blogs.msdn.com/stevenpr/archive/2005/02/28/381744.aspx"&gt;Loader&lt;/A&gt;, &lt;A href="http://blogs.msdn.com/stevenpr/archive/2005/06/22/431612.aspx"&gt;Native Interop&lt;/A&gt; and Network logs&lt;/LI&gt;
&lt;LI&gt;Configure log file naming options&lt;/LI&gt;
&lt;LI&gt;Enable &lt;A href="http://blogs.msdn.com/davidklinems/archive/2005/12/09/502125.aspx"&gt;performance statistics&lt;/A&gt; (.stat) file creation&lt;/LI&gt;
&lt;LI&gt;Enable &lt;A href="http://blogs.msdn.com/davidklinems/archive/2005/05/24/421566.aspx"&gt;attach to process support in the debugger&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Enjoy!&lt;BR&gt;-- DK&lt;BR&gt;&lt;BR&gt;&lt;FONT size=1&gt;Disclaimer(s): 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=734123" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Performance/default.aspx">Performance</category><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>The Error Log: A New Diagnostic in .NET Compact Framework v2 Service Pack 1</title><link>http://blogs.msdn.com/davidklinems/archive/2006/08/17/704662.aspx</link><pubDate>Thu, 17 Aug 2006 22:36:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:704662</guid><dc:creator>DavidKlineMS</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/davidklinems/comments/704662.aspx</comments><wfw:commentRss>http://blogs.msdn.com/davidklinems/commentrss.aspx?PostID=704662</wfw:commentRss><description>The &lt;A href="http://blogs.msdn.com/netcfteam/archive/2006/08/04/688766.aspx"&gt;recent release of Service Pack 1 for the .NET Compact Framework version 2&lt;/A&gt; has added some very useful diagnostic tools.&amp;nbsp; You may have already read about the &lt;A href="http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx"&gt;.NET Compact Framework Remote Performance Monitor&lt;/A&gt;, and have hopefully used it to analyze the performance characteristics of your applications.&amp;nbsp; Today, I would like to talk about another new diagnostic tool: the error log.&lt;BR&gt;&lt;BR&gt;With the addition of support for headless devices, it became apparent that we needed a means for capturing details about unexpected errors.&amp;nbsp; It is not always feasible to run applications under a debugger, and not all error conditions occur with the consistency that makes them easy to diagnose.&amp;nbsp; To help address this, the error log was created.&amp;nbsp; While the error log is typically most useful for headless devices, it is available for all devices running .NET Compact Framework version 2 service pack 1.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Enabling Error Logging&lt;/B&gt;&lt;BR&gt;The Error Log is enabled via the device's registry. In my steps, below, I will be using the Remote Registry Editor that is included with Visual Studio 2005.&amp;nbsp; 
&lt;P&gt;&lt;/P&gt;
&lt;TABLE borderColor=#800080 cellSpacing=0 width="50%" border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B&gt;WARNING&lt;/B&gt;: Using Remote Registry Editor incorrectly can cause serious problems that may require you to hard reset your device. Microsoft cannot guarantee that problems resulting from the incorrect use of Remote Registry Editor can be solved. Use Remote Registry Editor at your own risk.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;OL&gt;
&lt;LI&gt;Start the Remote Registry Editor 
&lt;UL&gt;
&lt;LI&gt;Open the Start Menu&lt;/LI&gt;
&lt;LI&gt;Select All Programs&lt;/LI&gt;
&lt;LI&gt;Select Microsoft Visual Studio 2005&lt;/LI&gt;
&lt;LI&gt;Select Visual Studio Remote Tools&lt;/LI&gt;
&lt;LI&gt;Select Remote Registry Editor&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;Connect to your device
&lt;UL&gt;
&lt;LI&gt;On the Target menu, select Connect&lt;/LI&gt;
&lt;LI&gt;Select your device and click OK&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;Enable diagnostic logging
&lt;UL&gt;
&lt;LI&gt;In the left hand pane, expand the device&lt;/LI&gt;
&lt;LI&gt;Expand HKEY_LOCAL_MACHINE&lt;/LI&gt;
&lt;LI&gt;Expand SOFTWARE&lt;/LI&gt;
&lt;LI&gt;Expand Microsoft&lt;/LI&gt;
&lt;LI&gt;Expand .NETCompactFramework&lt;/LI&gt;
&lt;LI&gt;Expand Diagnostics&lt;BR&gt;If this key does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on .NETCompactFramework&lt;/LI&gt;
&lt;LI&gt;Select New &amp;gt; Key Type "Diagnostics" (without quotes)&lt;/LI&gt;
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;Expand Logging&lt;BR&gt;If this key does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on Diagnostics&lt;/LI&gt;
&lt;LI&gt;Select New &amp;gt; Key&lt;/LI&gt;
&lt;LI&gt;Type "Logging" (without quotes)&lt;/LI&gt;
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;Set the value of Enabled to 1 &lt;BR&gt;If this value does not exist, you will need to create it
&lt;UL&gt;
&lt;LI&gt;Right click on Logging&lt;/LI&gt;
&lt;LI&gt;Select New &amp;gt; DWORD Value&lt;/LI&gt;
&lt;LI&gt;Set the Name to "Enabled" (without quotes)&lt;/LI&gt;
&lt;LI&gt;Set the value to 1&lt;/LI&gt;
&lt;LI&gt;Click OK &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;Enable error logging 
&lt;UL&gt;
&lt;LI&gt;In the Logging key (from step 3) expand Error&lt;BR&gt;If this key does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on Logging&lt;/LI&gt;
&lt;LI&gt;Select New &amp;gt; Key&lt;/LI&gt;
&lt;LI&gt;Type "Error" (without quotes)&lt;/LI&gt;
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;Set the value of Enabled to 1 &lt;BR&gt;If this value does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on Error&lt;/LI&gt;
&lt;LI&gt;Select New &amp;gt; DWORD Value&lt;/LI&gt;
&lt;LI&gt;Set the Name to "Enabled" (without quotes) &lt;/LI&gt;
&lt;LI&gt;Set the value to 1 &lt;/LI&gt;
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;To disable the Error Log, follow the above steps and set the value of Enabled to 0. To disable all logging, follow only steps 1-3, and set the value of Enabled to 0. &lt;/P&gt;
&lt;TABLE borderColor=#800080 cellSpacing=0 width="50%" border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B&gt;TIP&lt;/B&gt;: Set the value of UseApp (under Logging) to 1 to enable application specific log files.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;BR&gt;&lt;B&gt;Using the Error Log&lt;/B&gt;&lt;BR&gt;To demonstrate the error log, I created a very simple application that encounters an unhandled exception.&amp;nbsp; After the application exits (is terminated by clicking the Quit button), the error log file will be created.&lt;/P&gt;
&lt;TABLE borderColor=#800080 cellSpacing=0 width="50%" border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;B&gt;NOTE&lt;/B&gt;: On headless devices, error dialogs are dismissed automatically using the default button.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;After opening the log file, we can see the unhandled exception.&lt;BR&gt;&lt;BR&gt;&lt;CODE&gt;Caption: UnhandledException.exe&lt;BR&gt;Title : Error&lt;BR&gt;Text : An unexpected error has occurred in UnhandledException.exe.&lt;BR&gt;Select Quit and then restart this program, or select Details for more information.&lt;BR&gt;&lt;BR&gt;Cannot perform requested task at this time&lt;BR&gt;Details: (null)&lt;/CODE&gt;&lt;BR&gt;&lt;BR&gt;On devices with display capabilities, clicking the Details button will result in the following additional data being present in the error log file.&lt;BR&gt;&lt;BR&gt;&lt;CODE&gt;Caption: UnhandledException.exe&lt;BR&gt;Title : Error&lt;BR&gt;Text : UnhandledException.exe&lt;BR&gt;ApplicationException&lt;BR&gt;Cannot perform requested task at this time&lt;BR&gt;&lt;BR&gt;at UnhandledException.Program.PerformTask()&lt;BR&gt;at UnhandledException.Program.Main()&lt;BR&gt;&lt;BR&gt;Details: (null)&lt;/CODE&gt;&lt;BR&gt;&lt;BR&gt;As we can see, the new error log feature allows unexpected errors can now be captured in the field, without requiring users to copy large amounts of data manually from the device.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;Enjoy!&lt;BR&gt;-- DK&lt;BR&gt;&lt;BR&gt;&lt;FONT size=1&gt;Disclaimer(s): 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=704662" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>Using the Interop Log to Diagnose P/Invoke Call Issues</title><link>http://blogs.msdn.com/davidklinems/archive/2006/02/03/524471.aspx</link><pubDate>Sat, 04 Feb 2006 01:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:524471</guid><dc:creator>DavidKlineMS</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/davidklinems/comments/524471.aspx</comments><wfw:commentRss>http://blogs.msdn.com/davidklinems/commentrss.aspx?PostID=524471</wfw:commentRss><description>&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;Sometimes, determining why an unmanaged function call (P/Invoke) has failed can be challenging.&amp;nbsp; Fortunately, version 2 of the .NET Compact Framework has a new diagnostic log for this data -- the Interop Log.&amp;nbsp; In June 2005, &lt;A href="http://blogs.msdn.com/stevenpr"&gt;Steven Pratschner&lt;/A&gt; wrote a great post detailing the Inteop Log and it's contents: &lt;A href="http://blogs.msdn.com/stevenpr/archive/2005/06/22/431612.aspx"&gt;Diagnosing Marshalling Errors using Interop Logging&lt;/A&gt;. &lt;BR&gt;&lt;BR&gt;I would like to take some time to explore a specific example where the Interop Log can save time and make P/Invoke call debugging quick and easy.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Enabling the Interop Log&lt;BR&gt;&lt;/B&gt;The Interop Log is enabled via the device's registry. In my steps, below, I will be using the Remote Registry Editor that is included with Visual Studio 2005. &lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;B&gt;WARNING&lt;/B&gt;: Using Remote Registry Editor incorrectly can cause serious problems that may require you to hard reset your device. Microsoft cannot guarantee that problems resulting from the incorrect use of Remote Registry Editor can be solved. Use Remote Registry Editor at your own risk. &lt;/P&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;OL&gt;
&lt;LI&gt;Start the Remote Registry Editor 
&lt;UL&gt;
&lt;LI&gt;Open the Start Menu 
&lt;LI&gt;Select All Programs 
&lt;LI&gt;Select Microsoft Visual Studio 2005 
&lt;LI&gt;Select Visual Studio Remote Tools 
&lt;LI&gt;Select Remote Registry Editor &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Connect to your device 
&lt;UL&gt;
&lt;LI&gt;On the Target menu, select Connect 
&lt;LI&gt;Select your device and click OK &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Enable diagnostic logging 
&lt;UL&gt;
&lt;LI&gt;In the left hand pane, expand the device 
&lt;LI&gt;Expand HKEY_LOCAL_MACHINE 
&lt;LI&gt;Expand SOFTWARE 
&lt;LI&gt;Expand Microsoft 
&lt;LI&gt;Expand .NETCompactFramework 
&lt;LI&gt;Expand Diagnostics&lt;BR&gt;If this key does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on .NETCompactFramework 
&lt;LI&gt;Select New &amp;gt; Key 
&lt;LI&gt;Type "Diagnostics" (without quotes) 
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Expand Logging&lt;BR&gt;If this key does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on Diagnostics 
&lt;LI&gt;Select New &amp;gt; Key 
&lt;LI&gt;Type "Logging" (without quotes) 
&lt;LI&gt;Click OK &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Set the value of Enabled to 1 &lt;BR&gt;If this value does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on Logging 
&lt;LI&gt;Select New &amp;gt; DWORD Value 
&lt;LI&gt;Set the Name to "Enabled" (without quotes) 
&lt;LI&gt;Set the value to 1 
&lt;LI&gt;Click OK &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Enable interop logging 
&lt;UL&gt;
&lt;LI&gt;In the Logging key (from step 3) expand Interop&lt;BR&gt;If this key does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on&amp;nbsp;Logging 
&lt;LI&gt;Select New &amp;gt; Key 
&lt;LI&gt;Type "Interop" (without quotes) 
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Set the value of Enabled to 1&lt;BR&gt;If this value does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on Interop 
&lt;LI&gt;Select New &amp;gt; DWORD Value 
&lt;LI&gt;Set the Name to "Enabled" (without quotes) 
&lt;LI&gt;Set the value to 1 
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/P&gt;
&lt;P&gt;To disable the Interop Log, follow the above steps and set the value of Enabled to 0.&lt;BR&gt;To disable all logging, follow only steps 1-3, and set the value of Enabled to 0. &lt;/P&gt;
&lt;P&gt;There are a few optional settings that can be set to configure how the Interop Log is created. For details, please refer to &lt;A href="http://blogs.msdn.com/stevenpr/archive/2005/06/22/431612.aspx"&gt;Steven's post&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;One optional setting I highly recommend is to create application specific log files. This causes the .NET Compact Framework to name the log file based on your application name. For example, if I enable logging with the UseApp option, the log file created for an application called DkTest.exe will be netcf_DkTest_interop.log. &lt;/P&gt;
&lt;P&gt;To enable application specific log files please make the following addition to the above steps. &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Enable application specific log files &lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;In the Logging key set the value of UseApp to 1&lt;BR&gt;If this value does not exist, you will need to create it&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Right click on Logging 
&lt;LI&gt;Select New &amp;gt; DWORD Value 
&lt;LI&gt;Set the Name to "UseApp" (without quotes) 
&lt;LI&gt;Set the value to 1 &lt;/LI&gt;&lt;/UL&gt;
&lt;UL&gt;
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/OL&gt;
&lt;P&gt;&lt;B&gt;Diagnosing a P/Invoke call issue&lt;BR&gt;&lt;/B&gt;One of the things that I sometimes forget is that .NET types are not necessarily the same as Win32 types.&amp;nbsp; One type, in particular, where this is true is &lt;I&gt;&lt;B&gt;long&lt;/B&gt;&lt;/I&gt;.&amp;nbsp; On Win32, a long (or LONG) takes up 4 bytes (32 bits).&amp;nbsp; In the .NET world, a long is 8 bytes (64 bits) in size.&lt;BR&gt;&lt;BR&gt;Let's look at an example where this type size difference can cause application issues.&lt;BR&gt;&lt;BR&gt;First, a simple function written in C/C++&lt;BR&gt;&lt;CODE&gt;int SampleFunction(long lData)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // int == long on Win32 systems&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return lData;&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;/CODE&gt;To be able to call this function, our managed application must define the signature for the P/Invoke.&lt;BR&gt;&lt;CODE&gt;[DllImport("InteropLogExampleNative.dll", SetLastError=true)]&lt;BR&gt;public static extern int SampleFunction(long lData);&lt;BR&gt;&lt;/CODE&gt;&lt;BR&gt;Now we can call our function.&lt;BR&gt;&lt;CODE&gt;int result = SampleFunction(long.MaxValue);&lt;BR&gt;&lt;/CODE&gt;&lt;BR&gt;If you add the above code to a simple project and attempt to call the P/Invoke method, depending on the data passed to the function, you may encounter "calculation errors" related to the wrong data type being sent to the unmanaged function.&lt;BR&gt;&lt;BR&gt;If the Interop logging is enabled, we can see that the application tried to call the method with an 8 byte value when the method was expecting only 4 bytes.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;&lt;CODE&gt;[pinvokeimpl][preservesig]&lt;BR&gt;int InteropLogPInvokeExample.Program::SampleFunction(long );&lt;BR&gt;int (I4_VAL) SampleFunction(INT64 (I8_VAL) );&lt;BR&gt;&lt;/CODE&gt;&lt;BR&gt;To quote &lt;A href="http://blogs.msdn.com/stevenpr/archive/2005/06/22/431612.aspx"&gt;Steven&lt;/A&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. If this signature doesn’t match the actual signature of the targeted native function, a marshaling error will occur."&lt;BR&gt;&lt;BR&gt;By changing the P/Invoke signature to specify a 4 byte integer, the call succeeds.&lt;BR&gt;&lt;BR&gt;&lt;CODE&gt;// managed code&lt;BR&gt;// p/invoke method signature.&amp;nbsp; &lt;BR&gt;//&lt;BR&gt;// note: a Win32 long is the same size as a .NET int&lt;BR&gt;[DllImport("InteropLogExampleNative.dll", SetLastError=true)]&lt;BR&gt;public static extern int SampleFunction(int lData);&lt;/CODE&gt;&lt;BR&gt;&lt;BR&gt;These types of issues can sometimes be difficult to notice.&amp;nbsp; For example, in our simple unmanaged (native) function, we are simply returning the value passed as the argument.&amp;nbsp; If the value happens to be one that can fit within a 32 bit integer, the failure may go unnoticed.&amp;nbsp; If the value exceeds that which will fit in a 32 bit integer and the code does not validate the data returned from the call, the failure may also go unnoticed.&lt;BR&gt;&lt;BR&gt;The moral of this story is that it is very important to validate the behavior of all P/Invoke calls by examining the returned data or any other means appropriate.&amp;nbsp; I also highly recommend enabling Interop logging and examining the P/Invoke signature data in the log file as a standard part pre-checkin unit testing and release criteria if your application makes calls to unmanaged functions.&lt;BR&gt;&lt;BR&gt;Take care,&lt;BR&gt;-- DK&lt;BR&gt;&lt;BR&gt;&lt;FONT size=1&gt;Edit: Fix error in registry steps.&lt;BR&gt;Edit: Fix UseApp steps&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;Disclaimer(s):&lt;BR&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=524471" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item><item><title>Diagnosing MissingMethodExceptions and TypeLoadExceptions using the Loader Log</title><link>http://blogs.msdn.com/davidklinems/archive/2006/01/31/520899.aspx</link><pubDate>Tue, 31 Jan 2006 21:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:520899</guid><dc:creator>DavidKlineMS</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/davidklinems/comments/520899.aspx</comments><wfw:commentRss>http://blogs.msdn.com/davidklinems/commentrss.aspx?PostID=520899</wfw:commentRss><description>Have you ever encountered a MissingMethodException or TypeLoadException when starting a .NET Compact Framework application?&amp;nbsp; If you are running version 2 of the .NET Compact Framework, the Loader Log can help identify the source of the exception.&lt;BR&gt;&lt;BR&gt;For detailed information regarding the Loader Log, please read &lt;A href="http://blogs.msdn.com/stevenpr"&gt;Steven Pratschner&lt;/A&gt;'s excellent &lt;A href="http://blogs.msdn.com/stevenpr/archive/2005/02/28/381744.aspx"&gt;Better Diagnostics in Whidbey: Loader Logging&lt;/A&gt; post.&lt;BR&gt;&lt;BR&gt;&lt;B&gt;Enabling the Loader Log&lt;/B&gt;&lt;BR&gt;The Loader Log is enabled via the device's registry.&amp;nbsp; In my steps, below, I will be using the Remote Registry Editor that is included with Visual Studio 2005. 
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;WARNING&lt;/B&gt;: Using Remote Registry Editor incorrectly can cause serious problems that may require you to hard reset your device. Microsoft cannot guarantee that problems resulting from the incorrect use of Remote Registry Editor can be solved. Use Remote Registry Editor at your own risk. &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Start the Remote Registry Editor 
&lt;UL&gt;
&lt;LI&gt;Open the Start Menu 
&lt;LI&gt;Select All Programs 
&lt;LI&gt;Select Microsoft Visual Studio 2005 
&lt;LI&gt;Select Visual Studio Remote Tools 
&lt;LI&gt;Select Remote Registry Editor &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Connect to your device 
&lt;UL&gt;
&lt;LI&gt;On the Target menu, select Connect 
&lt;LI&gt;Select your device and click OK &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Enable diagnostic logging 
&lt;UL&gt;
&lt;LI&gt;In the left hand pane, expand the device 
&lt;LI&gt;Expand HKEY_LOCAL_MACHINE 
&lt;LI&gt;Expand SOFTWARE 
&lt;LI&gt;Expand Microsoft 
&lt;LI&gt;Expand .NETCompactFramework 
&lt;LI&gt;Expand Diagnostics&lt;BR&gt;If this key does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on .NETCompactFramework 
&lt;LI&gt;Select New &amp;gt; Key 
&lt;LI&gt;Type "Diagnostics" (without quotes) 
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Expand Logging&lt;BR&gt;If this key does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on Diagnostics 
&lt;LI&gt;Select New &amp;gt; Key 
&lt;LI&gt;Type "Logging" (without quotes) 
&lt;LI&gt;Click OK &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Set the value of Enabled to 1 &lt;BR&gt;If this value does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on Logging 
&lt;LI&gt;Select New &amp;gt; DWORD Value 
&lt;LI&gt;Set the Name to "Enabled" (without quotes) 
&lt;LI&gt;Set the value to 1 
&lt;LI&gt;Click OK &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Enable loader logging 
&lt;UL&gt;
&lt;LI&gt;In the Logging key (from step 3) expand Loader&lt;BR&gt;If this key does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on Logging 
&lt;LI&gt;Select New &amp;gt; Key 
&lt;LI&gt;Type "Loader" (without quotes) 
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Set the value of Enabled to 1&lt;BR&gt;If this value does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on Loader 
&lt;LI&gt;Select New &amp;gt; DWORD Value 
&lt;LI&gt;Set the Name to "Enabled" (without quotes) 
&lt;LI&gt;Set the value to 1 
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;To disable the Loader Log, follow the above steps and set the value of Enabled to 0.&lt;BR&gt;To disable &lt;B&gt;&lt;I&gt;all &lt;/I&gt;&lt;/B&gt;logging, follow only steps 1-3, and set the value of Enabled to 0.&lt;/P&gt;
&lt;P&gt;There are a few optional settings that can be set to configure how the Loader Log is created.&amp;nbsp; For details, please refer to &lt;A href="http://blogs.msdn.com/stevenpr/archive/2005/02/28/381744.aspx"&gt;Steven's post&lt;/A&gt;.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;One optional setting I &lt;I&gt;&lt;B&gt;highly&lt;/B&gt;&lt;/I&gt; recommend is to create application specific log files.&amp;nbsp; This causes the .NET Compact Framework to name the log file based on your application name.&amp;nbsp; For example, if I enable logging with the UseApp option, the log file created for an application called &lt;CODE&gt;DkTest.exe&lt;/CODE&gt; will be &lt;CODE&gt;netcf_DkTest_loader.log&lt;/CODE&gt;.&lt;BR&gt;&lt;BR&gt;To enable application specific log files please make the following addition to the above steps.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Enable application specific log files 
&lt;UL&gt;
&lt;LI&gt;In the Logging key et the value of UseApp to 1&lt;BR&gt;If this value does not exist, you will need to create it 
&lt;UL&gt;
&lt;LI&gt;Right click on Logging
&lt;LI&gt;Select New &amp;gt; DWORD Value 
&lt;LI&gt;Set the Name to "UseApp" (without quotes) 
&lt;LI&gt;Set the value to 1 
&lt;LI&gt;Click OK&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;B&gt;Diagnosing the exception&lt;/B&gt;&lt;BR&gt;To illustrate how the Loader Log can help identify the cause of these exceptions, I created a custom control that was built to incorrectly reference the full .NET Framework version of the System.Windows.Forms assembly.&amp;nbsp; I then built a simple application that used this control.&amp;nbsp; After running the application, the Loader Log contained the following data.&lt;BR&gt;&lt;BR&gt;&lt;CODE&gt;MissingType. Class [myControl.CustomButton], Assembly [myControl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null].&lt;BR&gt;&lt;/CODE&gt;&lt;BR&gt;Scrolling back up the log file, we find this entry.&lt;BR&gt;&lt;BR&gt;&lt;CODE&gt;Failed to load [System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=B77A5C561934E089]&lt;BR&gt;&lt;/CODE&gt;&lt;BR&gt;In examining this entry, we see that the &lt;CODE&gt;myControl.CustomButton&lt;/CODE&gt; assembly failed to load the &lt;CODE&gt;System.Windows.Forms&lt;/CODE&gt; assembly.&amp;nbsp; The reason was that the strong name of the &lt;CODE&gt;System.Windows.Forms&lt;/CODE&gt; assembly (Name, Version, Culture, PublicKeyToken) was not present on my device.&amp;nbsp; Take note of the value of PublicKeyToken.&amp;nbsp; By comparing the PublicKeyToken value of successfully loaded assemblies (ex: System.Xml), we find that, in this instance, they do not match.&lt;BR&gt;&lt;BR&gt;The PublicKeyToken specified in the strong name for the System.Windows.Forms assembly is that of the full .NET Framework.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;To date (versions 1 and 2), the .NET Compact Framework uses the &lt;CODE&gt;969DB8053D3322AC&lt;/CODE&gt; as it's PublicKeyToken in system assembly strong names.&lt;BR&gt;&lt;BR&gt;Enjoy!&lt;BR&gt;-- DK&lt;BR&gt;&lt;BR&gt;&lt;FONT size=1&gt;Edit: Fix UseApp steps&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;Disclaimer(s):&lt;BR&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=520899" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://blogs.msdn.com/davidklinems/archive/tags/Diagnostics/default.aspx">Diagnostics</category></item></channel></rss>