<?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>Andrew Arnott : Mobile devices</title><link>http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx</link><description>Tags: Mobile devices</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>GZip encoder for Compact WCF</title><link>http://blogs.msdn.com/andrewarnottms/archive/2008/10/01/gzip-encoder-for-compact-wcf.aspx</link><pubDate>Wed, 01 Oct 2008 05:13:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8971022</guid><dc:creator>andarno</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/8971022.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=8971022</wfw:commentRss><description>&lt;p&gt;The GZip encoder is not included in NetCF as it is on the desktop WCF, but it isn't hard to build yourself and in fact we have released a sample of exactly how to add your own GZip encoder to NetCF:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=108652"&gt;http://go.microsoft.com/fwlink/?LinkId=108652&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So many people have asked me for it lately I thought I'd better just post the link.&amp;#160; Have fun!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8971022" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Write a NetCF app that provisions your device from your device</title><link>http://blogs.msdn.com/andrewarnottms/archive/2008/02/04/write-a-netcf-app-that-provisions-your-device-from-your-device.aspx</link><pubDate>Mon, 04 Feb 2008 10:42:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7375455</guid><dc:creator>andarno</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/7375455.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=7375455</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/andrewarnottms/archive/2007/11/29/provisioning-smart-devices-an-introduction.aspx"&gt;My first post in the provisioning series&lt;/a&gt; introduced what provisioning of your Windows Mobile device means and the basics of why you would want to do it.&amp;#160; In future posts I'll give some concrete examples of XML that accomplish a few common tasks.&amp;#160; But what good are XML examples if you can't try them out on your device or emulator?&amp;#160; It would be much better if you had an app that would let you write in XML and see what happens when you send it to the provisioning API of Windows Mobile.&amp;#160; I'd like to introduce you to a sample I wrote just for this purpose.&amp;#160; &lt;/p&gt;  &lt;p&gt;The open-source &lt;a href="http://code.msdn.microsoft.com/provisionwm"&gt;Windows Mobile Provisioning tool&lt;/a&gt; is a .NET Compact Framework application that exposes provisioning directly to the user.&amp;#160; It will take strings of XML and pass them directly to Windows Mobile and return the resulting XML.&amp;#160; It also has an interface to help you set a proxy server and add domains to the Work network and crafts the provisioning XML for you.&amp;#160; &lt;/p&gt;  &lt;p&gt;Over time I may add additional built-in provisioning scenarios to the sample.&amp;#160; But for now, download it, compile it, and try it out.&amp;#160; Let me know what you think, either here or on the &lt;a href="http://code.msdn.microsoft.com/provisionwm/Thread/List.aspx"&gt;Discussions page&lt;/a&gt; for this sample.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7375455" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Provisioning/default.aspx">Provisioning</category></item><item><title>XmlSerializer compatibility between NetCF and the desktop</title><link>http://blogs.msdn.com/andrewarnottms/archive/2008/01/23/xmlserializer-compatibility-between-netcf-and-the-desktop.aspx</link><pubDate>Thu, 24 Jan 2008 00:28:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7212511</guid><dc:creator>andarno</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/7212511.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=7212511</wfw:commentRss><description>&lt;p&gt;The XmlSerializer found in the .NET Compact Framework has a very different implementation than the one found in the full .NET Framework.&amp;#160; The reasons for the differences include size and performance constraints that make the desktop's XmlSerializer inappropriate for devices.&amp;#160; &lt;/p&gt;  &lt;p&gt;As a result of the different implementation, there are inevitably going to be differences between how each serializer turns objects into XML and back again.&amp;#160; We try to minimize these differences so that your C# code will run on NetCF and desktop in a very portable way.&amp;#160; When we find differences, we have to weigh the consequences of possibly breaking backward compatibility with applications written for earlier versions of NetCF against breaking compatibility with desktop for current and future applications.&lt;/p&gt;  &lt;p&gt;One area where cross-platform compatibility becomes particularly important is in web services.&amp;#160; When you generate web service proxies for your NetCF applications using Visual Studio's Add Web Reference function (or the command line wsdl.exe, xsd.exe, or NetCFSvcUtil.exe tools) you expect those proxies to serialize to XML that the service is expecting.&amp;#160; These tools are generally developed and tested against the desktop's version of the XmlSerializer more thoroughly than against the NetCF XmlSerializer.&amp;#160; So any differences in how NetCF's XmlSerializer works could cause incompatible xml to be sent to a service.&lt;/p&gt;  &lt;p&gt;As I have been code reviewing .NET Compact Framework's version of the serializer and fixing bugs in it, I've come across a number of differences in how the two serializers behave that can affect web services.&amp;#160; Some of these fixes made it into NetCF 2.0 SP2.&amp;#160; Many more made it into NetCF 3.5.&amp;#160; But quite a few issues were discovered too late to fix in the NetCF 3.5 release.&amp;#160; &lt;/p&gt;  &lt;p&gt;In an upcoming NetCF release there are likely to be some breaking changes to the way the XmlSerializer works in order to improve web service and desktop compatibility.&amp;#160; This is likely to only affect applications that use multiple namespaces in a single type that is being serialized as that is where most of the bugs seem to be.&lt;/p&gt;  &lt;p&gt;You can prepare for these changes by testing your application on the full .NET Framework today.&amp;#160; If it runs correctly there, then it will probably run correctly on a future version of the .NET Compact Framework. If you notice that the XML the desktop produces is different than what NetCF produces, you will probably need to adjust your code so that it produces the desired XML on the full Framework, and consider releasing a service pack for your own application to your customers who are using new versions of NetCF.&lt;/p&gt;  &lt;p&gt;A full list of breaking changes is published with each release of the .NET Compact Framework.&amp;#160; You should review those if your NetCF app uses the XmlSerializer.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7212511" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category></item><item><title>Using the XmlSerializer as an XmlObjectSerializer with WCF</title><link>http://blogs.msdn.com/andrewarnottms/archive/2008/01/18/using-the-xmlserializer-as-an-xmlobjectserializer-with-wcf.aspx</link><pubDate>Fri, 18 Jan 2008 23:06:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7152596</guid><dc:creator>andarno</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/7152596.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=7152596</wfw:commentRss><description>&lt;p&gt;The Windows Communication Foundation introduced the new DataContractSerializer to replace the XmlSerializer in many scenarios.&amp;#160; The DataContractSerializer is faster than the XmlSerializer, but has certain limitations.&amp;#160; For example it does not support serializing an object's members as XML attributes.&amp;#160; When you write a WCF client that calls a service, WCF will generate a proxy class that defaults to using the DataContractSerializer and falls back to the XmlSerializer if the service uses features that the DataContractSerializer does not support.&amp;#160; This fallback mechanism is automatic if you're using WCF's service model.&lt;/p&gt;  &lt;p&gt;But if you're working at WCF's messaging layer, you must explicitly choose which serializer to use.&amp;#160; You can use any serializer that derives from &lt;a href="http://msdn2.microsoft.com/en-us/library/system.runtime.serialization.xmlobjectserializer.aspx"&gt;System.Runtime.Serialization.XmlObjectSerializer&lt;/a&gt;.&amp;#160; &lt;a href="http://msdn2.microsoft.com/en-us/library/system.runtime.serialization.xmlobjectserializer.aspx"&gt;System.Runtime.Serialization.DataContractSerializer&lt;/a&gt; already derives from this class -- but &lt;a href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx"&gt;System.Xml.Serialization.XmlSerializer&lt;/a&gt; does &lt;em&gt;not&lt;/em&gt;.&amp;#160; So you have some work to do before you can use the XmlSerializer as your serializer of choice at the messaging layer of WCF.&lt;/p&gt;  &lt;p&gt;In order to use the XmlSerializer to send messages with WCF, we have to define a class that derives from XmlObjectSerializer and uses the XmlSerializer internally.&amp;#160; In essence we will create a wrapper class for the XmlSerializer that makes it look and work like an XmlObjectSerializer.&amp;#160; XmlObjectSerializer is an abstract class with only a few methods we need to implement.&amp;#160; &lt;/p&gt;  &lt;p&gt;Below is a sample of a class that will do just that.&lt;/p&gt; &lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; Microsoft.ServiceModel.Samples
{
    &lt;span class="kwrd"&gt;using&lt;/span&gt; System;
    &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Diagnostics;
    &lt;span class="kwrd"&gt;using&lt;/span&gt; System.IO;
    &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Text;
    &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Xml;
    &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Xml.Serialization;
    &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Runtime.Serialization;

    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; CFMessagingSerializer : XmlObjectSerializer
    {
        &lt;span class="kwrd"&gt;readonly&lt;/span&gt; Type objectType;
        XmlSerializer serializer;

        &lt;span class="kwrd"&gt;public&lt;/span&gt; CFMessagingSerializer(Type objectType)
            : &lt;span class="kwrd"&gt;this&lt;/span&gt;(objectType, &lt;span class="kwrd"&gt;null&lt;/span&gt;, &lt;span class="kwrd"&gt;null&lt;/span&gt;)
        {
        }
        
        &lt;span class="kwrd"&gt;public&lt;/span&gt; CFMessagingSerializer(Type objectType, &lt;span class="kwrd"&gt;string&lt;/span&gt; wrapperName, &lt;span class="kwrd"&gt;string&lt;/span&gt; wrapperNamespace)
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (objectType == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span class="str"&gt;&amp;quot;objectType&amp;quot;&lt;/span&gt;);
            &lt;span class="kwrd"&gt;if&lt;/span&gt; ((wrapperName == &lt;span class="kwrd"&gt;null&lt;/span&gt;) != (wrapperNamespace == &lt;span class="kwrd"&gt;null&lt;/span&gt;))
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentException(&lt;span class="str"&gt;&amp;quot;wrapperName and wrapperNamespace must be either both null or both non-null.&amp;quot;&lt;/span&gt;);
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (wrapperName == &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty)
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentException(&lt;span class="str"&gt;&amp;quot;Cannot be the empty string.&amp;quot;&lt;/span&gt;, &lt;span class="str"&gt;&amp;quot;wrapperName&amp;quot;&lt;/span&gt;);
            
            &lt;span class="kwrd"&gt;this&lt;/span&gt;.objectType = objectType;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (wrapperName != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
            {
                XmlRootAttribute root = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlRootAttribute(wrapperName);
                root.Namespace = wrapperNamespace;
                &lt;span class="kwrd"&gt;this&lt;/span&gt;.serializer = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlSerializer(objectType, root);
            }
            &lt;span class="kwrd"&gt;else&lt;/span&gt;
                &lt;span class="kwrd"&gt;this&lt;/span&gt;.serializer = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlSerializer(objectType);
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; IsStartObject(XmlDictionaryReader reader)
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotImplementedException();
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; ReadObject(XmlDictionaryReader reader, &lt;span class="kwrd"&gt;bool&lt;/span&gt; verifyObjectName)
        {
            Debug.Assert(serializer != &lt;span class="kwrd"&gt;null&lt;/span&gt;);
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (reader == &lt;span class="kwrd"&gt;null&lt;/span&gt;) &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span class="str"&gt;&amp;quot;reader&amp;quot;&lt;/span&gt;);
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (!verifyObjectName)
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotSupportedException();

            &lt;span class="kwrd"&gt;return&lt;/span&gt; serializer.Deserialize(reader);
        }
        
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WriteStartObject(XmlDictionaryWriter writer, &lt;span class="kwrd"&gt;object&lt;/span&gt; graph)
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotImplementedException();
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WriteObjectContent(XmlDictionaryWriter writer, &lt;span class="kwrd"&gt;object&lt;/span&gt; graph)
        {
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (writer == &lt;span class="kwrd"&gt;null&lt;/span&gt;) &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span class="str"&gt;&amp;quot;writer&amp;quot;&lt;/span&gt;);
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (writer.WriteState != WriteState.Element)
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; SerializationException(&lt;span class="kwrd"&gt;string&lt;/span&gt;.Format(&lt;span class="str"&gt;&amp;quot;WriteState '{0}' not valid. Caller must write start element before serializing in contentOnly mode.&amp;quot;&lt;/span&gt;,
                    writer.WriteState));
            &lt;span class="kwrd"&gt;using&lt;/span&gt; (MemoryStream memoryStream = &lt;span class="kwrd"&gt;new&lt;/span&gt; MemoryStream())
            {
                &lt;span class="kwrd"&gt;using&lt;/span&gt; (XmlDictionaryWriter bufferWriter = XmlDictionaryWriter.CreateTextWriter(memoryStream, Encoding.UTF8))
                {
                    serializer.Serialize(bufferWriter, graph);
                    bufferWriter.Flush();
                    memoryStream.Position = 0;
                    &lt;span class="kwrd"&gt;using&lt;/span&gt; (XmlReader reader = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlTextReader(memoryStream))
                    {
                        reader.MoveToContent();
                        writer.WriteAttributes(reader, &lt;span class="kwrd"&gt;false&lt;/span&gt;);
                        &lt;span class="kwrd"&gt;if&lt;/span&gt; (reader.Read()) &lt;span class="rem"&gt;// move off start node (we want to skip it)&lt;/span&gt;
                        {
                            &lt;span class="kwrd"&gt;while&lt;/span&gt; (reader.NodeType != XmlNodeType.EndElement) &lt;span class="rem"&gt;// also skip end node.&lt;/span&gt;
                                writer.WriteNode(reader, &lt;span class="kwrd"&gt;false&lt;/span&gt;); &lt;span class="rem"&gt;// this will take us to the start of the next child node, or the end node.&lt;/span&gt;
                            reader.ReadEndElement(); &lt;span class="rem"&gt;// not necessary, but clean&lt;/span&gt;
                        }
                    }
                }
            }
        }

        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WriteEndObject(XmlDictionaryWriter writer)
        {
            &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NotImplementedException();
        }
        
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; WriteObject(XmlDictionaryWriter writer, &lt;span class="kwrd"&gt;object&lt;/span&gt; graph)
        {
            Debug.Assert(serializer != &lt;span class="kwrd"&gt;null&lt;/span&gt;);
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (writer == &lt;span class="kwrd"&gt;null&lt;/span&gt;) &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; ArgumentNullException(&lt;span class="str"&gt;&amp;quot;writer&amp;quot;&lt;/span&gt;);
            serializer.Serialize(writer, graph);
        }
    }
}&lt;/pre&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7152596" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/WCF/default.aspx">WCF</category></item><item><title>.NET Compact Framework 3.5 Power Toys RTW</title><link>http://blogs.msdn.com/andrewarnottms/archive/2007/12/10/net-compact-framework-3-5-power-toys-rtw.aspx</link><pubDate>Tue, 11 Dec 2007 01:49:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6728255</guid><dc:creator>andarno</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/6728255.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=6728255</wfw:commentRss><description>&lt;p&gt;The .NET Compact Framework 3.5 Power Toys have been released.&amp;#160; You can &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C8174C14-A27D-4148-BF01-86C2E0953EAB&amp;amp;displaylang=en"&gt;download them from here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Tools included in this package:&lt;/b&gt;    &lt;br /&gt;&lt;b&gt;Remote Performance Monitor and GC Heap Viewer&lt;/b&gt; &amp;#8211; 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;b&gt;NETCF CLR Profiler&lt;/b&gt; &amp;#8211; 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;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;b&gt;NETCF ServiceModel Metadata Tool&lt;/b&gt; &amp;#8211; 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;b&gt;Remote Logging Configuration Tool&lt;/b&gt; &amp;#8211; 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;b&gt;NETCF Network Log Viewer&lt;/b&gt; &amp;#8211; A utility for viewing NETCF network log data. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6728255" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/WCF/default.aspx">WCF</category></item><item><title>Provisioning smart devices: an introduction</title><link>http://blogs.msdn.com/andrewarnottms/archive/2007/11/29/provisioning-smart-devices-an-introduction.aspx</link><pubDate>Thu, 29 Nov 2007 19:19:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6600153</guid><dc:creator>andarno</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/6600153.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=6600153</wfw:commentRss><description>&lt;p&gt;A lot of questions on the MSDN forums center around how to customize a device or an app to prefer a specific network connection over another.&amp;#160; The correct way to accomplish this is by &amp;quot;provisioning&amp;quot; the device.&amp;#160; In fact a great many aspects of the device and the applications on it can be configured through 'provisioning' the device.&amp;#160; &lt;/p&gt;  &lt;p&gt;Since &lt;a href="Provisioning for Windows Mobile-Based Devices"&gt;provisioning&lt;/a&gt; is so broad, I've just started &lt;a href="http://blogs.msdn.com/andrewarnottms/archive/tags/provisioning/default.aspx"&gt;a tag&lt;/a&gt; for this topic, and I expect to post several times to this blog in the next little while on how to accomplish several common tasks through provisioning the device.&amp;#160; But because the topic is so broad, I want to give a brief overview of what it is, and point you to several MSDN resources that can help you get started.&amp;#160; &lt;/p&gt;  &lt;p&gt;You should be warned that provisioning a device incorrectly can wreak havoc with whatever system you altered in the process.&amp;#160; This means your cell phone or data plan could quit working, or your data plan will become the preferred network over wi-fi and cost you lots more money, or that all your browser favorites will disappear.&amp;#160; In short, lots of bad things can happen so you should consider testing on &lt;a href="http://msdn2.microsoft.com/en-us/library/bb158519.aspx"&gt;a device emulator&lt;/a&gt; before doing anything on a physical device.&lt;/p&gt;  &lt;p&gt;To provision a device, you send an XML document to the device via the device's &lt;a href="http://msdn2.microsoft.com/en-us/library/ms852998.aspx"&gt;DMProcessConfigXML native function&lt;/a&gt; or remotely from a desktop computer via the &lt;a href="ms-help://MS.MSDNQTR.v90.en/dv_coreconref/html/016e2ef0-3af9-7623-5815-d85d0b2df85f.htm"&gt;ProvisionDevice(...) method&lt;/a&gt; on the Microsoft.SmartDevice.Connectivity.Device managed class.&amp;#160; The .NET Compact Framework offers no managed wrapper to the DMProcessConfigXML function, so if you want to provision your device from an application running on the device itself you will have to P/Invoke into this function on your own.&amp;#160; It turns out that doing this properly is tricky and deserves a post of its own (stay tuned).&amp;#160; But if you're eager to get started check out the &lt;a href="http://pinvoke.net/default.aspx/aygshell.DMProcessConfigXML"&gt;P/Invoke.Net page on the function&lt;/a&gt; that I recently added.&lt;/p&gt;  &lt;p&gt;The XML document you send to the device is carefully crafted to either set or query parameters of some &lt;em&gt;characteristic&lt;/em&gt; of the device.&amp;#160; These characteristics may relate to your browser favorites list, the network connections available, the proxy server(s) available for use, speed dial settings, sounds, ActiveSync, etc. etc.&amp;#160; The full list is available from MSDN: &lt;a href="http://msdn2.microsoft.com/en-us/library/ms889539.aspx"&gt;Configuration Service Provider Reference for Windows Mobile-Based Devices&lt;/a&gt;.&amp;#160; For the purposes of NetCF-related efforts however, on this blog I will focus primarily on the network-related configuration settings you can reach through provisioning.&lt;/p&gt;  &lt;p&gt;In response to the XML document you send to the device, you get another XML document with the results of your query.&amp;#160; If you were just setting parameters, you essentially get the same XML document back.&amp;#160; If you were querying for existing settings, you will get an XML document similar to your request, except with all the values you requested filled in.&lt;/p&gt;  &lt;p&gt;In a future post I'll walk through a example of creating a NetCF app that allows the user to write XML, send it to the device, and read the XML that comes back.&amp;#160; Subsequent posts will then describe various XML snippets that will accomplish some useful tasks.&amp;#160; If you want to see me cover a specific scenario and give example XML (since I personally find the MSDN docs for XML samples to be sparse at best) drop a comment below and I'll do the best I can to cover the topics.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6600153" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Provisioning/default.aspx">Provisioning</category></item><item><title>Why .NET Compact Framework fails to call some HTTPS web servers</title><link>http://blogs.msdn.com/andrewarnottms/archive/2007/11/19/why-net-compact-framework-fails-to-call-some-https-web-servers.aspx</link><pubDate>Tue, 20 Nov 2007 01:18:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6412000</guid><dc:creator>andarno</dc:creator><slash:comments>34</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/6412000.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=6412000</wfw:commentRss><description>&lt;p&gt;A bug was discovered recently in the .NET Compact Framework version 2.0 (SP2 and earlier) and 3.5 that causes HttpWebRequest's directed at some HTTPS servers to fail with this error: (for web services)&lt;/p&gt;  &lt;p&gt;System.Net.WebException: Unable to read data from the transport connection. ---&amp;gt; System.Net.Sockets.SocketException: Unknown error (0x0).    &lt;br /&gt;&amp;#160;&amp;#160; at System.Net.HttpWebRequest.fillBuffer(HttpWebRequest request, Connection connection, CoreResponseData data)     &lt;br /&gt;&amp;#160;&amp;#160; at System.Net.HttpWebRequest.getLine(HttpWebRequest request, Connection connection, CoreResponseData data)     &lt;br /&gt;&amp;#160;&amp;#160; at System.Net.HttpWebRequest.parseResponse(HttpWebRequest request, Connection connection, Boolean defaultKeepAlive)     &lt;br /&gt;&amp;#160;&amp;#160; at System.Net.HttpWebRequest.startReceiving(Connection connection)     &lt;br /&gt;&amp;#160;&amp;#160; at System.Net.Connection.startReceiving(Object ignored)     &lt;br /&gt;&amp;#160;&amp;#160; at System.Threading.ThreadPool.WorkItem.doWork(Object o)     &lt;br /&gt;&amp;#160;&amp;#160; at System.Threading.Timer.ring() &lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160; at System.Net.HttpWebRequest.finishGetResponse()    &lt;br /&gt;&amp;#160;&amp;#160; at System.Net.HttpWebRequest.GetResponse()     &lt;br /&gt;&amp;#160;&amp;#160; // ...     &lt;br /&gt;&amp;#160;&amp;#160; at Program.Main(String[] args)&lt;/p&gt;  &lt;p&gt;For standard HttpWebRequest calls from your app the stack trace would be different, although the exception message and cause would be the same.&lt;/p&gt;  &lt;p&gt;While there are multiple reasons this exception can be produced, one thing that can cause it is if the server sends an empty encryption packet to the NetCF client.&amp;#160; Here is an illustration of the encryption process that occurs on the server for HTTPS:&lt;/p&gt;  &lt;p&gt;First, a memory buffer is initialized with unencrypted data that the server wants to send to the client over the network.&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="99"&gt;Step 1: &lt;/td&gt;        &lt;td valign="top" width="99"&gt;&amp;#160;&lt;/td&gt;        &lt;td valign="top" width="132"&gt;unencrypted data&lt;/td&gt;        &lt;td valign="top" width="68"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Next, the server makes a call to &lt;a href="http://msdn2.microsoft.com/en-us/library/aa375378.aspx"&gt;EncryptMessage&lt;/a&gt; and the unencrypted data is encrypted in place.&amp;#160; A header and footer is added to the buffer:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="99"&gt;Step 2: &lt;/td&gt;        &lt;td valign="top" width="99"&gt;header&lt;/td&gt;        &lt;td valign="top" width="132"&gt;encrypted data&lt;/td&gt;        &lt;td valign="top" width="68"&gt;footer&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;This header if 5 bytes long, and the footer is several more bytes.&amp;#160; This entire packet, which is necessarily longer than the original unencrypted data, is then sent down the wire where the process is reversed using a call to &lt;a href="http://msdn2.microsoft.com/en-us/library/aa375211.aspx"&gt;DecryptMessage&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The trouble with NetCF's SSL stack is when the server encrypts a buffer of &lt;em&gt;zero length&lt;/em&gt; and sends it to the client:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="99"&gt;Step 1: &lt;/td&gt;        &lt;td valign="top" width="99"&gt;&amp;#160;&lt;/td&gt;        &lt;td valign="top" width="132"&gt;0 bytes of unencrypted data&lt;/td&gt;        &lt;td valign="top" width="68"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="99"&gt;Step 2:&lt;/td&gt;        &lt;td valign="top" width="99"&gt;header&lt;/td&gt;        &lt;td valign="top" width="132"&gt;encrypted representation of a zero-length buffer&lt;/td&gt;        &lt;td valign="top" width="68"&gt;footer&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Although the original data had a length of zero, the encrypted version of it actually has a non-zero length.&amp;#160; When this packet is sent to a NetCF client, current versions of NetCF decrypt the packet and return a zero length buffer to the caller.&amp;#160; The semantics of a network Read method is traditionally that it blocks until some data is received, and if a zero length buffer is returned it is the sign that the socket was closed.&amp;#160; Because NetCF will return an empty buffer after decrypting an &amp;quot;empty&amp;quot; encryption packet, the caller may misinterpret this as a sign of a disconnected socket and terminate the connection.&lt;/p&gt;  &lt;p&gt;In fact this is exactly what happens in NetCF's web services code when calling services over SSL that respond with empty encryption packets.&amp;#160; As a result the connection fails before the response is fully received and an exception is thrown.&lt;/p&gt;  &lt;p&gt;What causes the server to send these empty encryption packets?&amp;#160; Technically it's legally allowed for these empty packets to be sent (although they are pointless), so depending on your server and its configuration this may never happen or it may happen regularly.&lt;/p&gt;  &lt;p&gt;Unfortunately there is no way to get NetCF to ignore these packets, so the only workarounds are these, in order of simplicity:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Don't use SSL to make your request (security implications here of course by sending your request and its response in clear text) &lt;/li&gt;    &lt;li&gt;Reconfigure your existing server in some way to get it to avoid generating these empty encryption packets. &lt;/li&gt;    &lt;li&gt;Build a new web server that will forward your device's requests on a separate connection to the ultimate target server and forward the responses back to the device.&amp;#160; This would work for web sites and web services.&amp;#160; But this new front-end server (which serves something of the role of a proxy server) would have to be configured to &lt;em&gt;not &lt;/em&gt;generate these empty encryption packets. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;[Added 1/2/08] &lt;/strong&gt;Build a device-side web proxy that calls into the SSPI functions itself (native would probably be easier than managed for this).&amp;#160; Then have your managed app call into the proxy.&amp;#160; This proxy would be responsible for consuming the empty packets and re-encrypting everything (if necessary to secure IPC) for the app on the same device without any empty SSL packets. &lt;/li&gt;    &lt;li&gt;Wait until a future version of NetCF that fixes this bug. &lt;/li&gt;    &lt;li&gt;Write your own HTTPS client using native code or P/Invoke'ing from NetCF (difficult to get right). &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;So how do you know for sure if the HTTPS server is sending empty encryption packets that are causing your NetCF clients to fail?&amp;#160; I wrote a native C++ app that calls a web server on an HTTPS connection and detects these packets.&amp;#160; (No, I'm afraid it can't filter them out for NetCF clients) By running this app against your web server the app will tell you whether your server generates these empty packets.&amp;#160; At least then you know what's going on.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;[Updated Feb 1, 2008]&lt;/strong&gt; You can download the source code from its &lt;a href="http://code.msdn.microsoft.com/emptysslpackets"&gt;resource page on the MSDN Code Gallery&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6412000" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/WCF/default.aspx">WCF</category></item><item><title>Trying out the iPhone</title><link>http://blogs.msdn.com/andrewarnottms/archive/2007/11/07/trying-out-the-iphone.aspx</link><pubDate>Wed, 07 Nov 2007 11:00:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5929059</guid><dc:creator>andarno</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/5929059.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=5929059</wfw:commentRss><description>&lt;p&gt;So I had the opportunity to try out the iPhone for a day.&amp;#160; Overall I was impressed, but there were some very basic features missing from many of the otherwise killer apps that I would greatly miss if I was to use the iPhone as my primary PDA and phone.&amp;#160; Here is a brief summary:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" border="1"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top"&gt;&amp;#160;&lt;/td&gt;        &lt;td valign="top"&gt;Pros&lt;/td&gt;        &lt;td valign="top" width="303"&gt;Cons&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Browsing&lt;/td&gt;        &lt;td valign="top"&gt;Beautiful.&lt;/td&gt;        &lt;td valign="top" width="302"&gt;No copy and paste, so no convenient way to copy that phone number from a web page into the dialer.&amp;#160; No support for flash or any other 3rd party extensions.&amp;#160; No way to change the Google search default (that I could see).&amp;#160; Slow over Edge -- though much better over Wi-Fi.&amp;#160; I found I like to browse faster than the rendering engine can keep up, resulting in waiting while the page that has already downloaded just draws to the screen.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Notes&lt;/td&gt;        &lt;td valign="top"&gt;Convenient, good auto-correct feature does a lot to make up for the non-tactile interface&lt;/td&gt;        &lt;td valign="top" width="301"&gt;No undo.&amp;#160; And no select feature either.&amp;#160; If you want to delete more than a few characters, you'll hold down the delete key, end up deleting too much accidentally, and look for that missing Undo key, only to give up and accept data loss.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Email&lt;/td&gt;        &lt;td valign="top"&gt;Nice to have a built-in app, especially when it connects to Gmail.&amp;#160; Good to have IMAP support to make up for the poor &amp;quot;Gmail&amp;quot;-dedicated option.&lt;/td&gt;        &lt;td valign="top" width="300"&gt;When I added Gmail, all emails came in as Unread.&amp;#160; No bulk method to mark them as read either, so I would have had to open each of 47 messages to mark them as read.&amp;#160; Also no conversation view of email as Gmail on the web has -- just the archaic individual message listing.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Overall Stability&lt;/td&gt;        &lt;td valign="top"&gt;The system was responsive most of the time.&lt;/td&gt;        &lt;td valign="top"&gt;Sometimes the whole screen would just freeze for several seconds for no apparent reason.&amp;#160; It would not respond to the one button I could press or any touch on the screen.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Google Maps&lt;/td&gt;        &lt;td valign="top"&gt;Multi-touch makes this great.&lt;/td&gt;        &lt;td valign="top"&gt;I actually have found Microsoft Live Maps to provide a more accurate freeway traffic condition (don't know why), so I would prefer to have Live Maps offered.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Voicemail&lt;/td&gt;        &lt;td valign="top"&gt;Of course I'm happy to see an app to visually make reviewing voicemails as easy as sifting an Inbox.&lt;/td&gt;        &lt;td valign="top"&gt;No cons here -- except that I rarely have more than a single voicemail message waiting for me anyway, so I wouldn't call this a killer app.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;YouTube&lt;/td&gt;        &lt;td valign="top"&gt;Entertaining&lt;/td&gt;        &lt;td valign="top"&gt;Poor video quality -- worse than a desktop computer it seemed.&amp;#160; Slow downloads over the Edge data connection.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Weather&lt;/td&gt;        &lt;td valign="top"&gt;Convenient one or two touch access to weather daily forecasts.&lt;/td&gt;        &lt;td valign="top"&gt;Unlike the dynamic calendar button on the home screen, the weather button reports a static &amp;quot;sunny 73 degree&amp;quot; all day every day.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Camera&lt;/td&gt;        &lt;td valign="top"&gt;High quality.&amp;#160; Cute animated shutter.&lt;/td&gt;        &lt;td valign="top"&gt;Issues pressing the &amp;quot;take picture&amp;quot; button not always taking the picture.&amp;#160; It could cause you to miss the perfect moment for your picture.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Phone dialer&lt;/td&gt;        &lt;td valign="top"&gt;Nice interface.&amp;#160; &lt;/td&gt;        &lt;td valign="top"&gt;I actually prefer the Windows Mobile Smartphone interface because it is more friendly to one-handed use.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top"&gt;Keyboard&lt;/td&gt;        &lt;td valign="top"&gt;I personally really like the touchscreen keyboard, especially because it affords more room for the beautiful display.&amp;#160; Auto-correct makes up where mistakes occur.&lt;/td&gt;        &lt;td valign="top"&gt;Virtually impossible to use with just one hand.&amp;#160; And yes, more mistakes are made than with a slide-out qwerty keyboard.&amp;#160; &lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Then of course there's the closed platform problem, and I miss the voice-activated search I have on my Windows Mobile Smartphone.&amp;#160; &lt;/p&gt;  &lt;h4&gt;Bottom line&lt;/h4&gt;  &lt;p&gt;Microsoft employment aside (since I tend to not let that get in the way of my personal purchase decisions), would I get an iPhone if I had $500 and a two-year contract I cared to get into?&amp;#160; I'm not sure.&amp;#160; If I did it would be for the mobile browsing experience and nothing more.&amp;#160; That's not worth $500 plus a two-year contract.&amp;#160; Check out &lt;a href="http://blogs.msdn.com/andrewarnottms/archive/2007/10/29/why-wait-for-a-zune-phone-smartphones-are-here-now.aspx"&gt;a recent post I did on Windows Mobile Smartphones&lt;/a&gt; for how I like to find inexpensive, very usable smartphones.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5929059" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category></item><item><title>Workaround for XmlSerializer T[] and List&lt;T&gt; bug</title><link>http://blogs.msdn.com/andrewarnottms/archive/2007/11/05/workaround-for-xmlserializer-t-and-list-t-bug.aspx</link><pubDate>Tue, 06 Nov 2007 00:34:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5919435</guid><dc:creator>andarno</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/5919435.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=5919435</wfw:commentRss><description>&lt;p&gt;The XmlSerializer in NetCF 2.0 has a bug where if a single serialization requires reflecting into types that use a mixture of Collection&amp;lt;T&amp;gt;-like types for the same T the XmlSerializer will throw an exception.&amp;#xA0; Here an example where CF 2.0 would crash:&lt;/p&gt;  &lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt; &lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; SerializingType1 {
   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;[] FirstNames;
   &lt;span class="kwrd"&gt;public&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; PhoneNumbers;
}&lt;/pre&gt;

&lt;p&gt;This type would fail to serialize under NetCF 2.0 because T = string would appear in two kinds of collections.  This next example would also fail if you were serializing TypeA, because it contains a TypeB instance which has the another kind of T collection.&lt;/p&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; TypeA {
   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;[] FirstNames;
   &lt;span class="kwrd"&gt;public&lt;/span&gt; TypeB b;
}
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; TypeB {
   &lt;span class="kwrd"&gt;public&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; PhoneNumbers;
}&lt;/pre&gt;

&lt;p&gt;If you can change the public API to use all T[] or List&amp;lt;T&amp;gt; and avoid the mixture, you've worked around the problem. So this would be the simplest workaround:&lt;/p&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; SerializingType1 {
   &lt;span class="kwrd"&gt;public&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; FirstNames;
   &lt;span class="kwrd"&gt;public&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; PhoneNumbers;
}&lt;/pre&gt;

&lt;p&gt;If you can't change the public API to maintain compatibility for your customers, here's another workaround that will eliminate the mixture for the XmlSerializer but keep the mixture for your customers.&lt;/p&gt;

&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; SerializingType1 {
   [XmlIgnore]
   &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;[] FirstNames {
      get { &lt;span class="kwrd"&gt;return&lt;/span&gt; firstNamesHiddenList != &lt;span class="kwrd"&gt;null&lt;/span&gt; ? firstNamesHiddenList.ToArray() : &lt;span class="kwrd"&gt;null&lt;/span&gt;; }
      set { firstNamesHiddenList = &lt;span class="kwrd"&gt;value&lt;/span&gt; != &lt;span class="kwrd"&gt;null&lt;/span&gt; ? &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt;(&lt;span class="kwrd"&gt;value&lt;/span&gt;) : &lt;span class="kwrd"&gt;null&lt;/span&gt;; }
   }
   [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
   [XmlArray(&lt;span class="str"&gt;"FirstNames"&lt;/span&gt;)]
   [Obsolete(&lt;span class="str"&gt;"This member is for internal use only."&lt;/span&gt;)]
   &lt;span class="kwrd"&gt;public&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; firstNamesHiddenList;
   &lt;span class="kwrd"&gt;public&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;string&lt;/span&gt;&amp;gt; PhoneNumbers;
}&lt;/pre&gt;

&lt;p&gt;This will make the XmlSerializer work, and the API to the customer appear to be the same, except for a public member that they should never use directly that is only there (and public) because the XmlSerializer requires it.&amp;#xA0; EditorBrowsableAttribute and ObsoleteAttribute are there to help the customer to not run into that member and use it when you didn&amp;#x2019;t intend them to.&amp;#xA0; &lt;/p&gt;

&lt;p&gt;This bug is fixed in .NET Compact Framework 3.5.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5919435" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/.NET/default.aspx">.NET</category></item><item><title>What do you think of the new WCF 'Store and forward' Mail Transport?</title><link>http://blogs.msdn.com/andrewarnottms/archive/2007/10/29/what-do-you-think-of-the-new-wcf-store-and-forward-mail-transport.aspx</link><pubDate>Mon, 29 Oct 2007 22:53:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5770194</guid><dc:creator>andarno</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/5770194.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=5770194</wfw:commentRss><description>&lt;p&gt;With the .NET Compact Framework 3.5 release which comes with Visual Studio 2008, a new Windows Communication Foundation transport is introduced that uses email as the communication mechanism.&lt;/p&gt;  &lt;p&gt;Others have already blogged about this new transport including &lt;a href="http://blogs.msdn.com/romanbat/archive/2006/10/21/windows-communication-foundation-compact-edition-and-the-story-of-the-lunch-launcher.aspx"&gt;Roman Batoukov&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/davidklinems/"&gt;David Kline&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I'd like to take a poll of the audience to see how you like the transport, including the documentation and samples that we ship with it.&amp;#xA0; Can you think of uses for an email transport?&amp;#xA0; Do you have any trouble figuring out how to use it?&amp;#xA0; Will you use it exclusively on desktop machines, mobile devices or both?&lt;/p&gt;  &lt;p&gt;Please comment below and let me know what you're doing with it! We'd like to know about any pain points you run into so we can fix it in the next version.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5770194" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Why wait for a Zune Phone? Smartphones are here now!</title><link>http://blogs.msdn.com/andrewarnottms/archive/2007/10/29/why-wait-for-a-zune-phone-smartphones-are-here-now.aspx</link><pubDate>Mon, 29 Oct 2007 18:06:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5766147</guid><dc:creator>andarno</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/5766147.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=5766147</wfw:commentRss><description>&lt;p&gt;The &lt;a href="http://www.apple.com/iphone/"&gt;iPhone&lt;/a&gt; was a hit, and people look to &lt;a href="http://arstechnica.com/news.ars/post/20060915-7756.html"&gt;Microsoft to produce a ZunePhone&lt;/a&gt; in some future version of their &lt;a href="http://www.zune.net/en-US/"&gt;Zune music player&lt;/a&gt;.&amp;#xA0; But I ask you, &amp;quot;Why?!&amp;quot;&amp;#xA0; What you may not be aware of is that Windows Smartphones &lt;em&gt;already do everything &lt;/em&gt;that we hope ZunePhone will do.&amp;#xA0; Just check out this feature list:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Music player (WMA, MP3, WAV, ringtones), with all the convenient music navigation of browsing by artist, album, genre, track, etc.&lt;/li&gt;    &lt;li&gt;Video player (WMV, and I don't know what other formats)&lt;/li&gt;    &lt;li&gt;&lt;em&gt;DRM-free&lt;/em&gt; &lt;/li&gt;    &lt;li&gt;Bluetooth and wi-fi support (depends on actual phone) &lt;/li&gt;    &lt;li&gt;Phone &lt;/li&gt;    &lt;li&gt;Contact list (that syncs with Outlook/Exchange) &lt;/li&gt;    &lt;li&gt;Calendar (that syncs with Outlook/Exchange) &lt;/li&gt;    &lt;li&gt;Email (that syncs with Outlook/Exchange) &lt;/li&gt;    &lt;li&gt;Voice notes &lt;/li&gt;    &lt;li&gt;Games &lt;/li&gt;    &lt;li&gt;3rd-party apps (&lt;a href="http://www.watercoolergames.org/archives/000723.shtml"&gt;step aside iPhone&lt;/a&gt;!) &lt;/li&gt;    &lt;li&gt;Not locked as a platform to any particular carrier &lt;/li&gt;    &lt;li&gt;&lt;em&gt;Free&lt;/em&gt; downloads of ringtones and apps (no carrier-tax just to put apps on your phone) &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;I have only listed features that might appear on some future ZunePhone (I have no insider information to make announcements for future Zunes, so don't read into these).&amp;#xA0; There are way more features on Smartphones than just what I have listed here.&lt;/p&gt;  &lt;p&gt;Just a small plug for the contacts list in a Smartphone: I've never seen and could never imagine a more easily and quickly navigable interface than the contacts list on a Windows Mobile Smartphone.&amp;#xA0; I can usually go from pulling out my phone to dialing someone's number in about three key presses.&lt;/p&gt;  &lt;p&gt;The price for one of these amazing Smartphones?&amp;#xA0; Since we don't have a closed platform like Apple, I can't give you a single price because there are so many different devices that you can choose from.&amp;#xA0; But here are a few really neat models available today with their links:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://cell-phones.search.ebay.com/htc-2125_Phones-w-o-Service-Contracts_W0QQ_trksidZm37QQcatrefZC11QQcoactionZcompareQQcoentrypageZsearchQQcopagenumZ1QQfromZR9QQfromZR9QQfsooZ1QQfsopZ1QQfstypeZ1QQftrtZ1QQftrvZ1QQsabfmtsZ1QQsacatZ64355QQsaobfmtsZinsifQQsspagenameZSTRKQ3aMEFSRCHQ3aSRCH"&gt;HTC 2125&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.htc.com/product/03-product_s710.htm"&gt;HTC S710&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.htc.com/product/03-product_s730.htm"&gt;HTC S730&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.motorola.com/motoinfo/product/details.jsp?globalObjectId=113"&gt;Moto Q&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;Personally, I bought an HTC 2125 Smartphone off of eBay for $100.&amp;#xA0; I thought it had the perfect balance of fits-in-your-pocket and decent viewable screen size.&amp;#xA0; As I've demonstrated, it runs circles around the iPhone and what I expect from the not-yet-produced ZunePhone, and it's at a small fraction of the cost, and with no two-year contract either.&amp;#xA0; &lt;/p&gt;    &lt;p&gt;Compare that to iPhone's $500 price tag plus 2 year contract requirement.&amp;#xA0; Oh, and it only works with AT&amp;amp;T (officially anyway).&lt;/p&gt;    &lt;p&gt;So get out there and &lt;a href="http://www.microsoft.com/windowsmobile/smartphone/default.mspx"&gt;buy a Windows Mobile Smartphone&lt;/a&gt; today!&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5766147" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category></item><item><title>Calling WCF services from NetCF 3.5 using Compact WCF and NetCFSvcUtil.exe</title><link>http://blogs.msdn.com/andrewarnottms/archive/2007/09/13/calling-wcf-services-from-netcf-3-5-using-compact-wcf-and-netcfsvcutil-exe.aspx</link><pubDate>Thu, 13 Sep 2007 02:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4885642</guid><dc:creator>andarno</dc:creator><slash:comments>16</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/4885642.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=4885642</wfw:commentRss><description>&lt;P&gt;The &lt;A href="http://msdn2.microsoft.com/en-us/netframework/aa497273.aspx" mce_href="http://msdn2.microsoft.com/en-us/netframework/aa497273.aspx"&gt;.NET Compact Framework&lt;/A&gt; 3.5 adds a subset of the &lt;A href="http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx" mce_href="http://msdn2.microsoft.com/en-us/netframework/aa663324.aspx"&gt;Windows Communication Foundation&lt;/A&gt; (WCF or "Indigo") to smart devices, allowing them to communicate with desktop WCF components with all the flexibility of multiple, interchangeable service bindings and endpoints.&amp;nbsp; Although it ships out of the box only with support for message-level communication (no service calls, per se), we have a code generation tool that will allow you to call WCF or other WSDL-publishing services.&lt;/P&gt;
&lt;P&gt;Desktop has an &lt;A href="http://msdn2.microsoft.com/en-us/library/aa347733.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/aa347733.aspx"&gt;svcutil.exe&lt;/A&gt; tool that generates client proxy code, but the source code it generates cannot compile against NetCF libraries because NetCF does not include all the classes referenced from that source code.&amp;nbsp; While you can modify the code by hand to eventually get it to work with NetCF, we offer an easier way.&lt;/P&gt;
&lt;P&gt;The NetCFSvcUtil.exe tool that ships as part of the &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C8174C14-A27D-4148-BF01-86C2E0953EAB&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C8174C14-A27D-4148-BF01-86C2E0953EAB&amp;amp;displaylang=en"&gt;Power Toys for .NET Compact Framework 3.5&lt;/A&gt;&amp;nbsp;supports many of the same command-line switches that svcutil.exe does, but performs a few additional/modified steps:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Verifies that the service being consumed&amp;nbsp;offers endpoints compatible&amp;nbsp;with the feature subset included in NetCF 3.5. 
&lt;LI&gt;Generates the client proxy class in C# or VB&amp;nbsp;that compiles against NetCF or desktop WCF. 
&lt;LI&gt;Generates code for a CFClientBase class that fills in where NetCF doesn't support calling WCF services. 
&lt;LI&gt;Does &lt;EM&gt;not&lt;/EM&gt; generate a .config file to store the endpoint information.&amp;nbsp; This information is stored in the client proxy code.&amp;nbsp; If an X509 certificate required by the endpoint, that must be passed into the proxy class' constructor by your code.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Assuming that you have a service running at http://localhost/service/service.svc&amp;nbsp;on your desktop computer and a device application in your C:\deviceapp directory, you could generate the code to call the service from NetCF using the following command line.&amp;nbsp; Be sure NetCFSvcUtil.exe is in your path.&amp;nbsp; Also be sure to use a machine name that can be reached from your device.&amp;nbsp; If you use "http://localhost/..." as your argument to the tool, your device will look for localhost (which is the device itself!) and not find the service that is running on your Windows box.&lt;/P&gt;
&lt;DIV class=command&gt;C:\deviceapp&amp;gt;netcfsvcutil.exe http://&amp;lt;machinename&amp;gt;/service/service.svc&lt;/DIV&gt;
&lt;P&gt;The tool will generate and list two source files.&amp;nbsp; The source file named after your service will be the one that contains the proxy class you'll use from your app.&amp;nbsp; You can use it just like you would the svcutil.exe-generated code, except for the provision of secure endpoints made in my numbered list above.&lt;/P&gt;
&lt;P&gt;To use these source files in your application, add them to your Visual Studio project and be sure you have System.ServiceModel.dll and System.Runtime.Serialization.dll in your project's Referenced Assemblies list in Solution Explorer.&amp;nbsp; Calling your service from your device application can be as simple as a couple of lines of code:&lt;/P&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;PRE class=csharpcode&gt;CalculatorServiceClient client = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; CalculatorServiceClient();
MessageBox.Show(client.Add(3, 5));&lt;/PRE&gt;
&lt;P&gt;Some features that WSDLs and the desktop .NET WCF supports are not supported by the .NET Compact Framework 3.5.&amp;nbsp; Although NetCFSvcUtil.exe generates code to enable some of these features,&amp;nbsp;here is a list of features that remain &lt;EM&gt;unavailable&lt;/EM&gt; for our first version of Compact WCF when calling a WCF service on desktop:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Fault contracts (they are not automatically deserialized for you, but you get the raw xml that you can parse manually) 
&lt;LI&gt;Custom message headers (including peer hop counts) 
&lt;LI&gt;Callback contracts 
&lt;LI&gt;Sessions 
&lt;LI&gt;Mandatory transactions&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;And the only desktop binding&amp;nbsp;NetCF 3.5&amp;nbsp;supports is basicHttpBinding, with optional WS-Security (X.509 only) and no support for WS-ReliableMessaging.&amp;nbsp; NetCF 3.5 adds the new mail transport as well, but NetCFSvcUtil does not support generating proxies for services exposed only on the mail transport.&lt;/P&gt;
&lt;P&gt;It's worthwhile to note that any service or client that supports WSDL contracts should be able to intercommunicate, regardless of underlying implementation.&amp;nbsp; This means that if you have a desktop WCF service that you want to call from NetCF, you may also use the already-existing &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxtskaddingremovingwebreferences.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxtskaddingremovingwebreferences.asp"&gt;Add Web Reference&lt;/A&gt; in Visual Studio to generate code for your client proxy class (the command line equivalent is &lt;A href="http://msdn2.microsoft.com/en-us/library/7h3ystb6(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/7h3ystb6(VS.80).aspx"&gt;wsdl.exe&lt;/A&gt;).&amp;nbsp; The resulting proxy class may not have as friendly of a public API for you to use, and it won't use the WCF stack, but it is a valid alternative that will work in&amp;nbsp;many cases.&lt;/P&gt;
&lt;P&gt;The reverse is also true: you can use WCF to call into old-style .asmx web services.&amp;nbsp; It is not necessary to even know which web service implementation is used on a server.&amp;nbsp; So long as it publishes a WSDL, you're in luck.&amp;nbsp; If it doesn't publish a WSDL, you may still be able to generate a client proxy for it as long as it uses WCF service model and you have access to the managed service assemblies.&amp;nbsp; But that's another topic.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4885642" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Power Toys for .NET Compact Framework 3.5 CTP released</title><link>http://blogs.msdn.com/andrewarnottms/archive/2007/09/13/power-toys-for-net-compact-framework-3-5-ctp-released.aspx</link><pubDate>Thu, 13 Sep 2007 02:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4885367</guid><dc:creator>andarno</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/4885367.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=4885367</wfw:commentRss><description>&lt;P&gt;The .NET Compact Framework team just released the Consumer Technology Preview (CTP) of the Power Toys for .NET Compact Framework 3.5.&amp;nbsp; These Power Toys are tools to help you build, debug and optimizie your NetCF 3.5 applications.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;My personal favorite is the NetCF ServiceModel Metadata Tool (NetCFSvcUtil.exe) which allows NetCF clients to call web services using the Compact WCF stack.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C8174C14-A27D-4148-BF01-86C2E0953EAB&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=C8174C14-A27D-4148-BF01-86C2E0953EAB&amp;amp;displaylang=en"&gt;Download it and check it out&lt;/A&gt;!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4885367" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/.NET/default.aspx">.NET</category></item><item><title>Reflections on having multiple versions of NetCF on your device</title><link>http://blogs.msdn.com/andrewarnottms/archive/2007/08/27/Reflections-on-having-multiple-versions-of-netcf-on-your-device.aspx</link><pubDate>Tue, 28 Aug 2007 01:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4598756</guid><dc:creator>andarno</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/4598756.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=4598756</wfw:commentRss><description>&lt;p&gt;The .NET Compact Framework has had several releases: V1 + 3 service packs, V2 + 2 service packs, V3.5 (to date just betas).&amp;#160; Which of these are installed on your device?&amp;#160; Can you have multiple versions installed simultaneously?&amp;#160; Which version will run your NetCF app if multiple versions are installed?&amp;#160; This post addresses all these questions.&lt;/p&gt;  &lt;h4&gt;Can you have multiple versions installed simultaneously?&lt;/h4&gt;  &lt;p&gt;NetCF supports side-by-side installations for distinct versions only.&amp;#160; For example, V1 and V2 may be installed on your device at the same time, but V2 and V2 SP1 may &lt;em&gt;not&lt;/em&gt; be installed at the same time.&amp;#160; After V3.5 is released, if a V3.6 were to come out it could be side-by-side installed with V3.5 since it is a distinct version.&lt;/p&gt;  &lt;p&gt;If you have a version installed in ROM and a service pack version with the same major and minor numbers installed in RAM, only the version in RAM is actually installed and will run your application.&lt;/p&gt;  &lt;h4&gt;Discovering which version(s) of NetCF is installed on your device&lt;/h4&gt;  &lt;p&gt;To see what is installed on your device right now, you can click Start -&amp;gt; Settings -&amp;gt; System -&amp;gt; Remove Programs and see what's listed.&lt;/p&gt;  &lt;p&gt;To find which version(s) are installed programmatically (say for a setup program you're writing), you can check the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETCompactFramework.&amp;#160; There are DWORD values under it named &amp;quot;X.Y.BBBB.mm&amp;quot; for each installed version of NetCF.&amp;#160; A value of 0 means it is installed in RAM while a value of 1 means it is installed in ROM.&amp;#160; Beware that if a version is in ROM (i.e. V1) and a newer build of the same version is installed in RAM (i.e. V1 SP3) then both of these will be listed as values in this registry key, although only the SP3 version will actually be present on the system.&lt;/p&gt;  &lt;p&gt;[Added 11/29/2007] Check out &lt;a href="http://blog.opennetcf.com/ncowburn/2007/08/22/HOWTODeterminingTheNETCompactFrameworkVersion.aspx"&gt;Neil Cowburn's blog post that contains a table of version numbers and releases for NetCF&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;Which NetCF version will run your app?&lt;/h4&gt;  &lt;p&gt;Review the flow chart or read the discussion below.&lt;/p&gt;  &lt;p align="center"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="607" src="http://blogs.msdn.com/blogfiles/andrewarnottms/WindowsLiveWriter/ReflectionsonhavingmultipleversionsofNet_D309/image%7B0%7D%5B8%5D.png" width="307" border="0" mce_src="http://blogs.msdn.com/blogfiles/andrewarnottms/WindowsLiveWriter/ReflectionsonhavingmultipleversionsofNet_D309/image%7B0%7D%5B8%5D.png" /&gt; &lt;/p&gt;  &lt;p&gt;A device.config file in your \windows directory may force all applications to run against a particular version of NetCF on your device, although an app-specific .config file takes precedence.&amp;#160; In the absence of a device.config file (which is not present by default), the following rules apply.&lt;/p&gt;  &lt;p&gt;If only one version of NetCF is installed on your device, it will run your app if it is at least as recent as the NetCF version that the application was built against.&amp;#160; So a V2 app will run on NetCF V2 and V3.5, but not on NetCF V1.&amp;#160; &lt;/p&gt;  &lt;p&gt;Service packs are excluded from this check, so if an application is written against NetCF 2.0 SP2, NetCF 2.0 RTM and SP1 will also run the app.&amp;#160; If that app takes dependencies on SP2 bug fixes, the app may break when run on V2 RTM and should therefore check at startup time to see what version of NetCF is running it and warn the user if the appropriate service pack is not installed.&amp;#160; The System.Environment.Version property will allow you to check the NetCF version and service pack your app is running on.&lt;/p&gt;  &lt;p&gt;If you have multiple versions of NetCF installed, a NetCF app will run against the version of NetCF it was compiled against if it is installed on the device.&amp;#160; If that version of NetCF is not installed, then the newest version of NetCF that is installed will be used.&amp;#160; For example, a V1 app run on a device with only V2 and V3.5 installed will run on V3.5.&lt;/p&gt;  &lt;p&gt;You can alter the default behavior with a .config file to force your app to load with a specific version of NetCF.&amp;#160; For example, on a device with V2 and V3.5 installed, you can force the V1 app to run against V2 (rather than the newest V3.5) by using a .config file.&amp;#160; For details on this process, see the MSDN documentation &lt;a href="http://msdn2.microsoft.com/en-us/library/d5cd9b2c.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/d5cd9b2c.aspx"&gt;How to: Configure Runtime Version&lt;/a&gt;.&lt;/p&gt;  &lt;h4&gt;Should you have multiple versions installed?&lt;/h4&gt;  &lt;p&gt;That depends on the applications you run and their requirements.&amp;#160; In theory, V2 SP2 should be able to run V1 apps because it has a &amp;quot;compatibility mode&amp;quot; that preserves old V1 behavior where needed by older apps.&amp;#160; V3.5 will offer the same backward compatibility feature.&amp;#160; But this &amp;quot;version coercion&amp;quot; feature is not perfect, and you may find that an app that runs on V1 won't run on V2.&amp;#160; In this case, installing V1 side-by-side with V2 is a good idea if you have memory on your device for it.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4598756" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category></item><item><title>The WCF subset supported by NetCF</title><link>http://blogs.msdn.com/andrewarnottms/archive/2007/08/21/The-WCF-subset-supported-by-NetCF.aspx</link><pubDate>Tue, 21 Aug 2007 02:23:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4485797</guid><dc:creator>andarno</dc:creator><slash:comments>21</slash:comments><comments>http://blogs.msdn.com/andrewarnottms/comments/4485797.aspx</comments><wfw:commentRss>http://blogs.msdn.com/andrewarnottms/commentrss.aspx?PostID=4485797</wfw:commentRss><description>&lt;p&gt;[Updated: 21Nov07 to clarify that custom headers are supported, but not in NetCFSvcUtil proxy generation]   &lt;br /&gt;[Updated: 27Aug07 to correct Gzip sample, and clarify on transports &amp;amp; extensibility]    &lt;br /&gt;[Updated: 23Aug07 to add SecurityAlgorithmSuite enumerable]&lt;/p&gt;  &lt;p&gt;Many people have been asking about what subset of .NET 3.0's Windows Communication Foundation (WCF) will be supported by the .NET Compact Framework 3.5.&amp;#160; Well, here is a table I put together with the answer to that question:&lt;/p&gt;  &lt;table class="" cellspacing="4"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td class="" valign="top"&gt;         &lt;p align="center"&gt;&lt;strong&gt;Feature&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td class="" valign="top"&gt;         &lt;p align="center"&gt;&lt;strong&gt;Desktop WCF&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;        &lt;td class="" valign="top"&gt;         &lt;p align="center"&gt;&lt;strong&gt;Compact WCF&lt;/strong&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;Bindings:&lt;/strong&gt;&lt;/td&gt;        &lt;td class=""&gt;&amp;#160;&lt;/td&gt;        &lt;td class=""&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; BasicHttpBinding&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; CustomBinding&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; WindowsMobileMailBinding&lt;/td&gt;        &lt;td class="" align="center"&gt;N/A&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; ExchangeWebServiceMailBinding&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes, via NetCF install&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;Formatters:&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;&amp;#160;&lt;/td&gt;        &lt;td class="" align="center"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; SoapFormatter&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; BinaryFormatter&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;Encoders:&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;&amp;#160;&lt;/td&gt;        &lt;td class="" align="center"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; TextMessageEncoder&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; BinaryMessageEncodingBindingElement&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; MTOMEncoder&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; GzipEncoder&lt;/td&gt;        &lt;td class="" align="center"&gt;Sample available&lt;/td&gt;        &lt;td class="" align="center"&gt;Sample available&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;Transports:&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;&amp;#160;&lt;/td&gt;        &lt;td class="" align="center"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; HttpTransportBindingElement&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; HttpsTransportBindingElement&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; MailTransportBindingElement&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes, via NetCF install&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; MsmqTransportBindingElement&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; TcpTransportBindingElement&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; (other transports)&lt;/td&gt;        &lt;td class="" align="center"&gt; Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;XmlDictionaryReader/Writer&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes; stub around XmlTextReader/Writer&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;DataContractSerializer&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No; but can be wire-compatible with DCS via XmlSerializer&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;Service proxy generation&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes; via SvcUtil.exe&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes; via NetCFSvcUtil.exe, not integrated into VS2008&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; Non-HTTP transports in generated proxies&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Not built-in&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; Custom headers in generated proxies&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Not built-in&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;WS-Addressing&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;WS-Security message level security&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;&amp;#160;&lt;/td&gt;        &lt;td class="" align="center"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; X.509&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; Username/password&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; SecurityAlgorithmSuite.Basic256Rsa15&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; SecurityAlgorithmSuite.Basic256&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;WS-ReliableMessaging&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;Patterns&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;&amp;#160;&lt;/td&gt;        &lt;td class="" align="center"&gt;&amp;#160;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; Service model&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; Message layer programming&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; Buffered messages&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; Streaming messages&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&amp;#183; Endpoint descriptions in .config files&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;Channel extensibility&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td class=""&gt;&lt;strong&gt;Security channel extensibility&lt;/strong&gt;&lt;/td&gt;        &lt;td class="" align="center"&gt;Yes&lt;/td&gt;        &lt;td class="" align="center"&gt;No&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4485797" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/Mobile+devices/default.aspx">Mobile devices</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/NetCF/default.aspx">NetCF</category><category domain="http://blogs.msdn.com/andrewarnottms/archive/tags/WCF/default.aspx">WCF</category></item></channel></rss>