Sunday, December 30, 2007

What's new for device developers in Visual Studio .NET 2008 and the .NET CF 3.5

With the recent advent of Visual Studio .NET 2008 and .NET Compact Framework 3.5 what is new, how will this platform make development easier? well this article talks about some of the great new features available to device application developers.

This article is broken down into sections:

New 3.5 Framework features:
  1. SystemSettings class (Microsoft.WindowsCE.Forms.dll) has a new propery named Platform that gets the operating system of the device. So now it is easier to determine whether you are running on a smartphone or a windows mobile device.
  2. SoundPlayer class (System.dll) - at last! This class initially introduced to the .NET Framework 2.0 is now available on mobile devices using the framework to play wav files.
  3. LINQ - language integrated query designed by Anders Hejlsberg - Chief Architect of C#. The namespace has recently changed (I believe in beta1) from System.Query, System.Xml.Query, System.Data.Query to System.Linq respectively. Compact Framework LINQ support is a subset of the desktop framework. Some of the limitations over the desktop version of LINQ are as follows: only standard operators are supported. LINQ to Xml and LINQ to DataSet is supported. LINQ to SQL and LINQ to Entities are *not* supported for memory constraint reasons, ;( See the LINQ Project web site to learn more on LINQ.
  4. Windows Communication Foundation (WCF). See here for the features of WCF that is supported under the .NET CF 3.5. Some of the limitations are; only HTTP binding support, only XML formating no binary.
  5. System.IO.Compression (System.dll) - at last!! the DeflateStream and the GZipStream classes are both supported on the .NET CF 3.5. We can now enjoy these compression classes on the mobile device that we have enjoyed since .NET 2.0 on the desktop.
  6. The Control class now suports the CreateGraphics method which returns the Graphics object so you can draw using GDI on the following controls:
    1. TabPage.
    2. Panel.
    3. Splitter.
    4. PictureBox.

  7. System.Delegate.CreateDelegate 1 static method is supported.
Device relevent SDK's that ship with Visual Studio .NET 2008:
  1. SQL Server Compact 3.5. This post talks about some of the new features with SQL Server Compact 3.5. Note this version of SQL Server can be used on the desktop as well as mobile devices.
  2. Windows Mobile 6 SDK. Although this SDK does ship with Visual Studio .NET 2008 and installs if you choose to install the CF, doing so when you already have WM6 SDK installed will result in it not being shown in VS 2008. See here for a work around.
Features that plug into Visual Studio .NET 2008:
  1. .NET CF 3.5 Power Toys. Currently in CTP not RTM. Required for WCF proxy generation. These tools do not come with VS 2008, you have to download them separately. There are some other really great tools that come with this install such as:
    1. Remote Performance Monitor.
    2. .NET CF CLR Profiler - very handy tool.
    3. Application Configuration Tool.
    4. Remote Logging Configuration Tool.
    5. .NET CF Network Log Viewer.
You can download a CTP version of .NET CF 3.5 Power Toys here.

Visual Studio .NET 2008 features:

  1. Unit Testing. At last, built in unit testing which allows you to run tests right on your device or emulator. See this post if you are running into issues getting it to work.
  2. Improved documentation. You can filter by supported CF members as the CF documentation is not separate from the desktop. Each member os flagged whether it is supported on the CF. See here for more information on identifying supported members.
Of course there are many more enhancements in Visual Studio .NET 2008 not listed, the ones above are documented because they are specific to device application development.

Types of devices supported by the .NET Compact Framework 3.5:

  1. Windows Mobile 2003 for Pocket PC.
  2. Windows Mobile 2003 for Pocket PC SE.
  3. Windows Mobile 5.0 for Pocket PC.
  4. Windows Mobile 6.0 for Pocket PC.
  5. Windows Mobile 5.0 for Smartphone.
  6. Windows Mobile 6.0 for Smartphone.
  7. Windows Embedded CE 6.0.
NOTE: Windows Embedded pre CE 6.0 is not supported by the .NET Compact Framework 3.5.
I have used old naming for the above re: WM 6. For new naming see this post.

Compact Framework versions supported by Visual Studio .NET 2008 (multi-targeting):
  1. .NET Compact Framework 2.0.
  2. .NET Compact Framework 3.5.
If you want to target CF 1.0 apps, you will need to use Visual Studio .NET 2005 as Visual Studio .NET 2008 doesn't support CF1.0.

For new C# 3.0 and VB 9.0 language features available in the .NET Compact Framework 3.5 as well of course available in the desktop framewok 3.5 with Visual Studio .NET 2008, see here.

1 comment:

Anonymous said...

InnerWorkings has teamed with Microsoft to offer some free VB 2008 and LINQ training for .NET developers - it's all hands-on, embedded in Visual Studio, and practice based.

http://www.innerworkings.com/promotions/75d4bd51-4bf1-4d8a-8c47-73135e44837a/visual-studio-2008-promotion