Welcome to MSDN Blogs Sign in | Join | Help

We, the NetCF team, have decided to combine our blog with the other teams doing mobile development work in our organization, namely the Visual Studio for Devices team and the Silverlight Mobile team.

From now on, all .Net Compact Framework material will be posted on the Mobile Developer blog.  We'll continue to keep this site up so you can still find all the previous material we've posted.

Enjoy the new site!

Thanks,

The NetCF team.

The Power Toys for .NET Compact Framework 3.5 have just gone live at http://www.microsoft.com/downloads/details.aspx?familyid=C8174C14-A27D-4148-BF01-86C2E0953EAB&displaylang=en. If you downloaded a previous version, you might want to upgrade as there have been several bug fixes and improvements made to several of the tools.

What’s New

Many here are likely familiar with Remote Performance Monitor which shipped as a part of .NET Compact Framework 2.0 SP1 and the Heap Viewer extension that shipped 2.0 SP2. This time we’ve added the CLR Profiler based on the desktop tool, NetCF SVCUtil for making it easy to consume WCF services on device, and the App Config tool for creating config files on the fly. We’ve improved our remote tools platform to make it significantly easier to use: client side tools components now deploy automatically so tools “just work”, everything works with emulators and a common device manager UI is provided to keep tabs on all your remote devices.

Comprehensive documentation for the tools is now also provided out of the box in the form of a chm file.

The Tools

NETCF CLR Profiler – CLR Profiler is an instrumenting allocation profiler for NETCF applications. It provides detailed allocation visualizations, allocation callstacks and other views of the managed heap for diagnosing various memory management issues.

NETCF ServiceModel Metadata Tool – 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.

App Configuration Tool - On-device tool for specifying what version of NETCF an application will run against (ie. Create config file), displaying installed versions of NETCF and displaying info about DLLs in the GAC.

Remote Logging Configuration Tool– The Logging Configuration Tool enables users to easily configure logging options on a NETCF device including: loader, interop, network, error and finalizer logs. (used to be a part of RPM)

Remote Performance Monitor and GC Heap Viewer – 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 leaks.

NETCF Network Log Viewer – A utility for viewing NETCF network log data.

Other Notes

Steven Pratschner has a few links to some overview on the tools here: http://blogs.msdn.com/stevenpr/archive/2007/12/10/powertoys-for-the-net-compact-framework-version-3-5-now-released.aspx.

Enjoy!

On his blog, Andrew discusses an HTTPS bug in NetCF that causes NetCF to throw a WebException when connecting to some servers, and its possible workarounds.

Over the past couple of months, I have been serializing my experiences in writing the Lunch Launcher demo (as seen at MEDC 2007) using the new Store and Forward Messaging feature of .NET Compact Framework version 3.5.  The series is now complete and the full table of contents is listed here.

The Journey of the Lunch Launcher
Part 1 - The origins of the 'lunch launcher'
Part 2 - MEDC 2007
Part 3 - Managing the Transport
Part 4 - Sending messages
Part 4b - The output channel
Part 5 - Receiving messages
Part 6 - Processing messages
Part 7 - The Lunch Manager
Part 8 - What did I learn?

Enjoy!

Disclaimer(s):
This posting is provided "AS IS" with no warranties, and confers no rights.
The information contained within this post is in relation to beta software.  Any and all details are subject to change.

Hey everyone,

I've posted a quick overview of how to use the .NETCF Remote Logging tool to help debug WCF applications on the .NET Compact Framework. You can find it here.

 -Dan

 

I've updated the .NET Compact Framework catalog with the some new applications and libraries, and some minor edits to existing entries. 

 

Click on this link to see our application catalog.

 

The catalog contains applications that I find out about through web searches and emails from developers.  We're always looking for applications and libraries to add to our catalog.  Applications and libraries we discover are used for

  • posting updates to our team blog (you are here!) to show what types of applications are being built with .NET Compact Framework.  This page gets thousands of visits monthly, so having your app listed here can be an effective supplemental means of publicizing your application and company.
  • candidates for basic compatibility testing with new versions of the .NET Compact Framework under development.  This helps us do our best to ensure that existing applications – like yours – continue to work well with new versions of the .NET Compact Framework. 

 

If your application isn't on the list - I'd love to add it.  Send an email to cfapp@microsoft.com (include name of application, which platforms it targets, required version of NETCF and URL).  If you need product support, please use the MSDN Feedback Center as this will ensure your issue gets into our databases where we can respond to it and track it.

 

Michael Lipp

Senior SDET

.Net Compact Framework

 

Disclaimers: This posting is provided "AS IS" with no warranties, and confers no rights.

The Power Toys for .NET Compact Framework 3.5 CTP (September 2007) has just been released as an MSDN download.

This was originally slated to be released with the Core .NET Compact Framework, but was spun off as a side download.

Included in this release:

Remote Performance Monitor and GC Heap Viewer – 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.

NETCF CLR Profiler – 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.

App Configuration Tool (NetCFcfg.exe) - 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.

NETCF ServiceModel Metadata Tool – 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.

Remote Logging Configuration Tool – The Logging Configuration Tool enables users to easily configure logging options on a NETCF device including: loader, interop, network, error and finalizer logs.

NETCF Network Log Viewer – A utility for viewing NETCF network log data.

Andrew Arnott discusses which versions of the .NET Compact Framework can be side-by-side installed, and which version will run your NetCF app on his blog.

Andrew Arnott details the features of WCF that are and are not supported by NetCF on his blog.

On his blog, Andrew Arnott discusses how to avoid depending on the internal details of NetCF (or the desktop .NET Framework).

 

Microsoft .NET Compact Framework version 2.0 SP2 release is completed and is in the process of being released.  This service pack was driven customer feedback including improvements in stability, adds new heap tracking feature to the Remote Performance Monitor.

The .NET Compact Framework will be delivered to customers through various channels in the next few months.  Each channel and location will be reported on here.

Release Channels

(The links below will be updated as each release goes live)

Release Location

Web Download
http://www.microsoft.com/downloads/details.aspx?FamilyID=aea55f2f-07b5-4a8c-8a44-b4e1b196d5c0&displaylang=en

WCE 4.2 QFE

http://www.microsoft.com/downloads/details.aspx?FamilyId=C49236E8-EB1F-446D-809A-A469022C2F08&displaylang=en

WCE 5.0 QFE

http://www.microsoft.com/downloads/details.aspx?FamilyId=31B27925-0CF7-47F5-ACE2-DA478BF4F0BC&displaylang=en

WCE 6.0 QFE

http://www.microsoft.com/downloads/details.aspx?FamilyId=021F5CFD-95FE-4BCF-AED2-15C0296370DA&displaylang=en

Visual Studio 2005 Patch

New Features:
Service Pack 2 of the .Net Compact Framework V2.0 includes new features in the Remote Performance Monitor aimed at finding memory leaks in the managed heap. These features allow you to take snapshots of the GC heap at any point in time and view the relationships between the live object instances in the heap. You can also compare multiple snapshots over time in order to spot allocation trends in your application as it executes.


Fixed Bugs:

  • NETCFRPM fails on x64
  • Setup install/uninstall fails silently when the MSI is launched from Control Panel-Programs and Features on Vista
  • Finalizers fail on RTF objects because COM bindings are already disposed
  • VS crashes on trying to attach without setting the Attach Enabled Registry Key
  • Thread.Join() fails with ERROR_INVALID_HANDLE on CE 6.0 platform
  • Potential memory corruption caused by circular reference
  • JIT assertion failure when non-existent COM port is addressed
  • TypeLoadException using generics with NETCF 2.0
  • IrDA is broken on Windows CE 5.0 devices
  • NetCFRPM and MDBG cannot target headless devices
  • SerialPort: Data corruption occurs if DataReceived event is used to receive Unicode characters sent across serial ports
  • SerialPort: Cannot open a COM port beyond COM9
  • SerialPort: GetPortNames() does not return serial port names beyond COM9
  • NETCF deadlocks on exit if native callback delegate has been called on native thread
  • VS 2005 RTM attempts to deploy NETCFv2.wce5.ARMV4I.cab/System_SR_ENU.cab instead of NETCFv2.wm.ARMV4I.cab/System_SR_ENU_wm.cab on Windows Mobile 6 platforms
  • XmlSerializerializationWriter: When GetSpecifiedMember returns false serialization is halted resulting in loss of data
  • Access violation marshaling a class with a string field
  • Stepping out from a Breakpoint after Func eval causes breakpoint to remain at same place and then VS 2005 hangs
  • COM: Access violation in N->M byref marshaling
  • Native exception in marshalling code when using Interlocked.Exchange
  • Access violation in StubPolicyAlloc (eestub\policy.cpp
  • SerialPort.Open thows IOException on CE 6.0 devices
  • Type.GetDefaultMembers() doesn't return base type's default members
  • Installing multiple locales of same MSI results in multiple instances of NetCF showing up in Add Remove Programs
  • VS 2005 attempts to deploy System_SR_ENU.cab instead of System_SR_ENU_wm.cab on Windows Mobile 6 platforms
  • Debugger does not correctly handle new native threads entering through COM
  • NETCFRPM parses connection string improperly when device uses ipv6
  • V2 SP2: HttpWebRequest: HTTPS request fails when TLS_RSA_WITH_3DES_EDE_CBC_SHA cipher is used
  • Debugger may AV if breakpoints active before F5
  • WebBrowser's NavigatingEventArgs does not allow to cancel navigation
  • XmlSerializer fails to deserialize enum's with spaces

Top of page

During our test pass against v2 sp2, we tested backwards compatibility with previous releases by running internal tests archived from previous releases.  We also tested 90 retail applications and found a couple issues outlined below.

 

Application Compatibility Issue

The issue only affected one application and occurs when the application tries to save a new template file and displays a warning about overwriting a file that doesn’t exist. The user can answer “yes, overwrite” to this warning and this will cause the template file to be saved correctly. We’re waiting to hear back from the ISV regarding this issue.

 

Breaking Change

We also found a breaking change through our regular, feature testing. This change was made to match the serialization behavior found on the full .Net Framework. The details of this breaking change are listed below:

 

XmlSerializer serializes object members in order more closely resembling declaration order where no order is explicitly defined.

 

Previous Behavior: XmlSerializer would scramble the order of XmlElements in a serialized object unless the Order property was set on XmlElementAttribute and similar attributes.

 

New Behavior: XmlSerializer now takes care to preserve the order that members are reflected from serialized objects where no Order property is explicitly set.  Note that where element ordering is important, explicitly setting the Order property is still recommended on both NetCF and .NET Framework to guarantee proper serialization order across platforms and versions.

 

Application Compatibility Test Details

Notes about the 90 applications we tested

  • 30 sdk samples (NETCF & Windows Mobile SDK’s), 60 retail applications
  • 54 were built with NETCF v1, 36 were built with NETCF v2

 

Applications were tested on a matrix of devices which included

  • PocketPC or Smartphone
  • Windows Mobile 5 or Windows Mobile 6
  • High/low resolution screens
  • NETCF installed in RAM or ROM

 

.Net Compact Framework Application Catalog

In January I posted an update to the list of applications we’ve found that use Netcf.  I’ve recently updated this list in response to feedback I received from developers who wanted their application listed other adjustments.

 

If your application isn't on the list and you would like it to be, send an email to cfapp@microsoft.com and I'll get it posted with the next update.  If you need product support or want to request a feature, please use the MSDN Feedback Center as this will ensure your issue gets into our databases where we can respond to it and track it.

 

Michael Lipp

SDET Technical Lead

.Net Compact Framework

 

Disclaimers: This posting is provided "AS IS" with no warranties, and confers no rights.

Here's the scenario: You are writing an NetCF app and trying to call a web service from that app.  You generated the code for the client proxy class using Visual Studio's "Add Web Reference" command.  Code is generated, you call into it, and you run your app.  The call fails with a cryptic error from the web service saying something about a malformed message.  If you try the same thing from a desktop app it works perfectly.  Sound familiar?  Read on for the reason and solution.

I'll address the common cause of xml element mis-ordering here.

Background

Web services and serializers

Calling web services involves serializing objects and sending the resulting xml to the web service, and deserializing the xml response back into objects.  This is usually totally transparent to the developer, who just invokes a method and the magic happens behind the scenes.  The serialized objects come from classes that are usually generated for you by Visual Studio or command-line tools like wsdl.exe or svcutil.exe.  They are constructed based on the service WSDL in such a way that their serialized format matches what the service is expecting, and such that they can be deserialized from the xml the service will respond with.  These classes are called "client proxy classes."

Both the desktop .NET Framework and the .NET Compact Framework use the XmlSerializer class for serializing and deserializing these objects.  When using the WCF stack, the desktop framework will use their recently added DataContractSerializer instead of the XmlSerializer.  Both of these serializers rely on reflection to query the generated client proxy classes and to generate the required xml. 

Reflection

The .NET runtime does not ever care about the order a given type's elements are declared.  For example, the class:

class Fruit {
   int seeds;
   string color;
}

Is equivalent to

class Fruit {
   string color;
   int seeds;
}

This makes sense.  Unfortunately though, because of this when you use reflection to query the members of a type, the order of those members is not guaranteed to be in declaration order, or even to be consistent as you switch between versions of the .NET Framework.  In fact, the order in which reflection returns members did in fact change between versions 1.1 and 2.0 of the framework. 

How non-deterministic ordering affects web services

Because the serializers in .NET rely on reflection, they are affected by the non-deterministic ordering of members that reflection provides.  The order of elements serialized will change with whatever order reflection provides members in.

The .NET designers anticipated this problem, and provided a way to force a specific ordering of serialized elements.  The xml serializer attributes that you can decorate your serializable classes with support an Order attribute that you can use to guarantee some desired ordering of elements.  For example, you could force the Fruit class used earlier to put <seeds> before <color> no matter what order reflection provides by changing the class to read like this:

class Fruit {
   [XmlElementAttribute(Order=1)] int seeds;
   [XmlElementAttribute(Order=2)] string color;
}

The attributes will retain the Order property's value regardless of reflection order, and that information can be used within the serializer to keep the order to the way the app developer intended.

The problem: why it "works" on desktop's framework and not on NetCF

Although neither desktop nor NetCF's framework guarantees ordering, it so happens that desktop's serializer preserves the order better than NetCF's.  Desktop's serializer isn't perfect either, but it's predictable enough that developers take its order for granted and then wonder why NetCF's serializer doesn't behave the same way. 

Unfortunately, the wsdl.exe and Visual Studio IDE developers were among those developers that seem to have forgotten that ordering is not guaranteed unless explicitly defined, and so neither generate the code in the client proxy classes to set the Order properties necessary to guarantee the correct ordering.  It seems they assumed that declaration order is the default, since the desktop framework (mostly) works that way. 

The wsdl.exe tool does offer an "/order" switch that will set order explicitly, but unfortunately this command line tool generates code that won't compile on NetCF projects because of the limited API exposed by NetCF. 

The workaround

So until the code is fixed in Visual Studio and/or wsdl.exe, you have a couple of options to get your NetCF projects to call these web services that require specific order:

  1. Use wsdl.exe /order to generate your client proxy class, and then remove all the code not supported by NetCF until your project compiles. 
  2. Use Visual Studio to generate your client proxy class, then run wsdl.exe /order in some other directory, and copy just those lines of source code from the resulting class into your project source file that give the explicit ordering.

The ultimate fix

There are a few fixes I'm personally working on to help alleviate this inconvenience for app developers.

  1. I'm trying to get Visual Studio Orcas to include explicit ordering for all generated proxy client classes.
  2. I have changed NetCF's XmlSerializer to preserve declaration order serialization as closely as possible (still not guaranteed).  You'll have to be running on NetCF 2.0 SP2 or later to get this fix. 
  3. The svcutil.exe tool (which deprecates wsdl.exe) automatically generates explicit ordering code where required with no extra steps for the app developer.

Summary

The XmlSerializer cannot guarantee element order either on desktop .NET Framework or the .NET Compact Framework unless the developer gives the order explicitly, although in some cases the "default" ordering will behave as you expect and in some cases it won't. 

The bottom line: where element order is important, use XmlElementAttribute.Order, XmlArrayAttribute.Order, and the other ordering attributes as necessary.

I've posted an updated .NET Compact Framework catalog to the internet.  The catalog has outgrown the capabilities of our blog editor so it's now posted as a stand alone web page that will be updated periodically.  When it's updated, I'll post another entry here, to the team blog.  This update includes a number of applications that we learned about thanks to a paragraph included in a recent http://www.Handango.com developer newsletter.

 

Click on this link to see our application catalog.

 

The catalog contains applications that I find out about through web searches and emails from developers.  We're always looking for applications and libraries to add to our catalog.  Applications and libraries we discover are used for

  • posting updates to our team blog (you are here!) to show what types of applications are being built with .NET Compact Framework.  This page gets thousands of visits monthly, so having your app listed here can be an effective supplemental means of publicizing your application and company.
  • candidates for basic compatibility testing with new versions of the .NET Compact Framework under development.  This helps us do our best to ensure that existing applications – like yours – continue to work well with new versions of the .NET Compact Framework.

 

If your application isn't on the list, I'd love to include it if you send an email to cfapp@microsoft.com (include name of application, which platforms it targets, required version of NETCF and URL).  If you need product support, please use the MSDN Feedback Center as this will ensure your issue gets into our databases where we can respond to it and track it.

 

Michael Lipp

SDET Tech Lead

.Net Compact Framework

 

 

Disclaimers: This posting is provided "AS IS" with no warranties, and confers no rights.

The .NET Compact Framework team has spent the last year planning and developing the next version of the .NET Compact Framework 3.5, which will align with the .NET Framework 3.5 shipping in next version of Visual Studio code named “Orcas”.  The team has focused its efforts in 4 areas including, addressing core problems of creating distributed mobile applications by enabling mobile devices to interoperate with Windows Communication Foundation services, Implementing device specific features from LINQ, continuing to implement highly requested features and refining NETCF’s ability to diagnose and solve reliability and supportability issues. 
 
The first release of NETCF 3.5 went public a few weeks ago in the Orcas January CTP.  This release of NETCF does not include the complete list of features but is a step toward the final feature set.  New builds of NETCF will be included in each new public drop of Orcas with the majority of features being included by Orcas Beta1.  Below is a list of features included in the January CTP.  If you’re interested in these new features start by downloading the Orcas January CTP using either the VPC image at http://www.microsoft.com/downloads/details.aspx?FamilyId=1FF0B35D-0C4A-40B4-915A-5331E11C39E6&displaylang=en or try installing it to your test PC at http://www.microsoft.com/downloads/details.aspx?FamilyId=69055927-458B-4129-9047-FCC4FACAE96C&displaylang=en
 
 
New Features Included in the Orcas January CTP:
• System.IO.Compression support, including support for HTTP compression.
• Support for a subset of Linq’s Standard Query Operators.
• SoundPlayer support using WaveOut allowing for multiple sounds to play at once.
• New API in Microsoft.WindowsCE.Forms for easily distinguishing Smartphone and Pocket PC.
• Allow Nested FuncEval's.
• Enhanced logging for interop functionality with native code.
• Stack Trace Enhancements.
• GAC Improvements.
• Allow for StrongName keys greater than 1024 long.
• To improved logging of finalizer activities to enhance product supportability.
• Allow log files to be read at runtime.
More Posts Next page »
 
Page view tracker