Differences from Desktop in .NET Compact Framework Development

Before you start a device project, you should understand the differences between desktop development using the .NET Framework and device development that uses the.NET Compact Framework.

Language-Integrated Query (LINQ) in .NET Compact Framework version 3.5 includes a subset of the desktop LINQ features. . For more information, see LINQ in the .NET Compact Framework.

When you program against the .NET Compact Framework using Visual Basic, you do not have the same list of programming elements, such as functions and keywords, that you have when you program against the full .NET Framework. These differences are summarized in Visual Basic Language Reference for Devices and noted in the individual topics for those elements in the Visual Basic Reference.

Visual Studio includes support for My.Resources, My.Forms, and My.WebServices. It does not include support for My.Application, My.Computer, My.User, or My.Settings. For more information, see My Reference.

Visual Basic offers two options for file input/output (I/O):

  • The standard .NET Framework System.IO namespace. All languages in the common language runtime (CLR) support these libraries.

  • A set of Visual Basic-specific libraries that provides a development experience similar to that of earlier versions of Visual Basic.

Device projects support only the .NET Framework System.IO namespace. File I/O with the FileSystem namespace is not supported because:

  • Several frequently used features of the FileSystem namespace do not exist on devices. For instance, there is no concept of a current directory or a current drive on devices. Therefore, you cannot use the ChDir and ChDrive functions.

  • Supporting only the .NET Framework System.IO namespace reduces the size of the Visual Basic helper libraries. This frees valuable space on the device.

In Visual Basic, an object is late-bound when it is assigned to a variable declared to be of type Object Data Type. Objects of this type are bound at run time. You can assign to them and retrieve values from them. But you cannot specify the methods or properties of an object variable using the dot convention. The following code causes a compiler error because it tries to get the property of an object:

dim a as object = "automobile"

dim i as integer = a.horsepower

Desktop developers use COM interoperability to draw on existing COM objects while they transition to the .NET Framework at their own pace. Device projects support only certain scenarios for COM interop. For more information, see COM Interoperability for Devices.

Attaching to running processes differs somewhat from the desktop. For more information, see How to: Attach to Managed Device Processes.

Community Additions