Differences Between the .NET Compact Framework and the .NET Framework
The .NET Compact Framework is a subset of the full .NET Framework. It implements approximately 30 percent of the full .NET Framework class library and also contains features and classes that are specific to mobile and embedded development.
This topic does not describe all the differences between the two Frameworks, but lists the important considerations for developing applications.
The .NET Compact Framework does not currently support loading assemblies into a domain-neutral code area for use by multiple application domains. For more information, see Application Domains in the .NET Compact Framework.
Although some languages support lower bounds other than zero, the common language runtime (CLR) does not and throws a MissingMethodException if the first element is not zero.
Applications for both Frameworks use assemblies. Both Frameworks access portable executable (PE) files, which contain the Microsoft intermediate language (MSIL) and metadata that define a .NET Framework application. A PE file can refer to a programming namespace that is defined and shared by other assembly files. See Binary Compatibilities with the Full .NET Framework for more information.
The .NET Compact Framework supports a subset of the .NET Framework class library. This subset is appropriate for applications that are designed to run on resource-constrained devices and is semantically compatible with same-named classes in the .NET Framework.
For information about how to determine .NET Compact Framework support, see How to: Find Supported Members of the .NET Compact Framework in the Class Library.
For information about COM interop and marshaling differences between .NET Compact Framework and the full .NET Framework, see Interoperability in the .NET Compact Framework.
The common language runtimes in both Frameworks benefit from managed code execution, just-in-time (JIT) code compilation, and garbage collection. They support the Common Language Specification (CLS).
Both Frameworks have built-in primitive types as well as other types that you can use and derive from when you build your application.
The common language runtime for the .NET Compact Framework is approximately 12 percent the size of the full .NET Framework common language runtime.
The .NET Compact Framework supports most of the Windows Forms controls provided by the full .NET Framework and contains controls that are specific to the .NET Compact Framework.
Windows Forms controls are specially built for the .NET Compact Framework. For more information, see Controls in the .NET Compact Framework.
The functionality of a current directory is not present in the Windows Embedded CE operating system. Therefore, the .NET Compact Framework does not support the GetCurrentDirectory and SetCurrentDirectory methods.
The .NET Compact Framework provides a subset implementation of ADO.NET and includes the SQL Server Mobile data provider. The System.Data.OleDb namespace is not supported. For more information about data support, see Data Access and XML Support in the .NET Compact Framework.
The .NET Compact Framework does not support the MidpointRounding enumeration.
In a division calculation, if the divisor is very large or at the maximum floating-point value, or it is very low or at the minimum floating-point value, the calculation returns 0 (zero) instead of the correct calculation.
The MIPS platform does not support the full precision specified by the Standard for Binary Floating-Point Arithmetic (IEEE 754), and can cause unpredictable results. Because of performance considerations, the .NET Compact Framework does not provide a floating-point emulation capability for this platform.
Asynchronous delegates, specifically BeginInvoke and EndInvoke methods, are not supported. For more information, see Asynchronous Programming Using Delegates.
The .NET Compact Framework does not support configuration files for tracing, but you can use performance counters. For more information, see Performance and Diagnostics in the .NET Compact Framework.
The full .NET Framework does not guarantee that accessing properties or methods on a disposed object will always succeed. However, accessing some properties such as Text often does succeed on the .NET Framework. Because of implementation differences between the two Frameworks, accessing methods or properties on a disposed object will almost always fail on the .NET Compact Framework.
Localization (globalization) support, such as date formatting and sort tables appropriate for the locale, defers to the underlying operating system whenever possible for compatibility and size efficiency.
The .NET Compact Framework depends on the operating system for sorting data. Therefore, sorting may produce unexpected results for some cultures.
The .NET Compact Framework does not support per-thread CurrentUICulture settings.
For more information about localization support, see Encoding and Localization in the .NET Compact Framework.
Windows Embedded CE resolves a file name that is specified without path information as being in the root directory of the device, not in the application directory. To ensure successful operations, specify absolute path information.
The .NET Compact Framework processes Uniform Resource Identifier (URI) strings prefixed by file:// differently from the full .NET Framework. A relative specification such as file://myfile resolves as \\myfile. The URI string file:///myfile (with three forward slashes) resolves as \myfile in the root directory.
You can get the version of an assembly with the Version property, but its support depends on the manufacturer of the device and cannot be guaranteed.
To get the name of the directory that contains an application, see How to: Get the Application Directory.
In the .NET Compact Framework 2.0 and later versions, DPI resolution is automatically handled in Visual Studio projects. For more information about high resolution, see How to: Handle Orientation and Resolution Changes.
The .NET Compact Framework is optimized for battery-powered systems and avoids heavy use of RAM and CPU cycles. For more information about how to save memory, see Device Memory Management in the .NET Compact Framework and How to: Improve Performance.
The .NET Compact Framework provides Infrared Data Association (IrDA) classes for making infrared connections and Web listening classes for servicing HTTP requests to the device. These classes are available only in the .NET Compact Framework. For more information, see Networking and Connectivity in the .NET Compact Framework.
The .NET Compact Framework does not support all the code generated by the Web Services Description Language Tool (Wsdl.exe). To determine which code is not supported, see How to: Use a Proxy Generated by Wsdl.exe.
The .NET Compact Framework does not support the System.Reflection.Emit namespace.
The .NET Compact Framework does not currently support the equality operator (==) when it compares reflection objects such as MethodInfo, FieldInfo, PropertyInfo, EventInfo, MemberInfo, MethodBase, ConstructorInfo, and ParameterInfo. As an alternative, see Implementing the Equals Method.
The .NET Compact Framework does not support remoting. See Message Queuing in the .NET Compact Framework for alternative solutions.
Security differences and considerations are described in Security in the .NET Compact Framework.
However, the .NET Compact Framework does provide serialization support for transmitting object data by using SOAP in XML Web services, and serializing datasets to XML.
A .NET Compact Framework application creates up to four threads:
A main application thread.
A thread that is used to control various period timers and time-outs that can be scheduled by the system or by applications.
A thread that is used to track changes to the active TCP/IP interfaces (simulating the media sense behavior that is present on Windows XP but not on Windows Embedded CE).
A thread that is used to run object finalizers. This thread is created when the first finalizable object is garbage-collected.
For more information about threading support, see Threading in the .NET Compact Framework.
The compact supports the Visual Basic My feature (see Development with My), except for the following My objects:
Because of size considerations, the .NET Compact Framework does not support XML schema validation. It does support the XML Document Object Model (DOM). For more information, see Data Access and XML Support in the .NET Compact Framework.