Ever since .NET Compact Framework was introduced at the PDC conference in 2001, programming with .NET has scaled from some of the smallest devices to the largest servers. With C# and Visual Basic, developers can apply the same skills to program both devices and servers to form a complete end-to-end solution. As the devices become more prevalent in our daily lives, .NET is evolving too. Abhishek Mondal, the program manager for .NET Compact Framework, shares the following highlights of the latest version. –Brandon
Updated 11/17/2012: Corrected wording about Thumb2 use.
NETCF 3.9 advances the Windows Embedded Compact Platform
We are happy to announce that we will be including the .NET Compact Framework 3.9 in Windows Embedded Compact 2013, as part of its upcoming release. We have made major updates in this version of the .NET Compact Framework, which deliver benefits in startup time, application responsiveness and memory utilization. You should see significantly better performance characteristics of your applications on both x86 and ARM devices, running Windows Embedded Compact 2013. You can read more about the Windows Embedded Compact 2013 release at the Microsoft News Center.
The .NET Compact Framework is a version of the .NET Framework for embedded devices. It provides .NET development support for low-end embedded devices that run the Windows Embedded Compact 2013 OS. NETCF provides a familiar and rich development platform for embedded application development, with a small foot print and an extensive set of .NET functionality. For clarity, the other Windows Embedded OSes use the desktop .NET Framework, the same version that is included with desktop Windows.
NETCF 3.9 is based on the NETCF version that shipped with Windows Phone 7.5. The following features are the key advances in NETCF 3.9, all big steps forward for app performance:
- New Generational Garbage Collector for more responsive apps
- NETCF runtime is now multi-core safe to take advantage of multi-core hardware
- Sharing Server feature that reduces working set and improves app launch
Another major benefit of NETCF 3.9 is Visual Studio 2012 support! You will be able to use the same tools for Windows Embedded Compact 2013 development as you use for Windows, Windows Phone and Windows Azure development. Visual C++ development for this new Windows Embedded Compact version will also be supported in Visual Studio 2012, as reported on the Visual C++ team blog.
Applications run (a lot) faster with NETCF 3.9
NETCF 3.9 is a faster and leaner runtime for Windows Embedded Compact 2013. We have made many changes that should enable your apps to run much faster. NETCF is also multi-core safe, enabling you to take advantage of multiple cores on embedded devices. Multiple cores are increasingly available on today’s devices, and can be an important part of delivering a compelling experience to your customers. Let’s take a more in-depth look at some of the additional improvements that are part of NETCF 3.9.
Faster app performance
NETCF 3.9 has greatly improved performance overall. There are three key features that will speed up your apps. Let’s start with the new garbage collector in NETCF. We have observed app performance in the lab that shows 50-60% drops in GC time. We no longer see GC pauses significantly affecting app responsiveness, in our lab apps, which was a problem that was reported in the past. The new GC is a lot faster!
For apps that use floating point arithmetic code, you may notice an additional performance boost, since NetCF takes advantage of ARM VFP instructions.
Last, we’ll look at the new Sharing Server feature. Sharing Server enables a significant improvement in the warm start-up time of your app, particularly in scenarios where multiple applications run on a device. It is able to achieve this benefit by sharing loaded assemblies and JITed machine code across apps (including re-launching the same app).
Efficient memory utilization of managed application
The Sharing Server feature also enables lower memory use for NETCF 3.9 apps. As already discussed, the Sharing Server allows code to be reused across applications. In addition to benefiting app launch performance, this feature significantly lowers the aggregate memory use of devices in scenarios where multiple apps are in use.
Developing apps with NETCF 3.9
You will find that NETCF is a great addition to a modern development environment. You can use Visual Studio 2012 for development, including features such as Team Foundation Server for source control and feature management.
Visual Studio 2012 will support Windows Embedded Compact development
The single most compelling attraction of this release for many of you is the support for embedded development in Visual Studio 2012. This support will simplify development if you are already developing for both Windows or Windows Phone and Windows Embedded Compact, since you can do all of your work in a single Visual Studio environment.
If you develop exclusively for the embedded platform, then Visual Studio 2012 support will enable you to use ALM tools and TFS in your development environment. There are also other benefits to Visual Studio 2012 such as performance improvements and other tools, which you can explore and enjoy.
Here is a snapshot of a sample managed application developed using NETCF 3.9 with VS2012:
A simple “Hello World” application on NETCF 3.9
You can see this same app, running in Hyper-V, stopped at a breakpoint in Visual Studio 2012, using remote debugging:
Debugging a NETCF 3.9 app on Windows, using Hyper-V
NETCF 3.9 is source compatible with NETCF 3.5
NETCF 3.9 is a big step forward for performance, however, the APIs that you’ve used in NETCF 3.5 stay the same. As a result, you can move existing .NETCF source code and investments forward to NETCF 3.9.
You may wonder why NETCF 3.9 is source compatible with NETCF 3.5 and not binary compatible, since .NET assemblies are compiled to the machine-independent MSIL format. There is no change in our assembly format, nor are there any compatibility checks in NETCF 3.9.
We chose a single compatibility message for Windows Compact Embedded 2013, for both native and .NET development, which is source compatibility. The single biggest driver of this support policy is C++, which needs to be re-compiled for the ARM thumb2 instruction set, with the new Visual Studio 2012 Visual C++ compiler. We have also found that many of you pair your managed code with native implementations. As part of re-compiling that native code, we expect that you may make API changes that would affect your P/Invoke declarations. As a result, we decided that a single compatibility policy for the whole release was the best choice.
If you are an embedded developer, I’m sure that you are excited that we are making NETCF 3.9 available to you for your embedded apps. We have already talked to a set of developers, who are looking forward to this big update, to significantly improve the runtime performance of the apps that you run on your devices. We look forward to seeing your new devices and the rich experiences that they deliver, after Windows Embedded Compact 2013 is released.
NETCF 3.9 will be made available with the Windows Embedded Compact 2013 OS, when it is released. It isn’t available at this time. It will also be included in the SDK for the OS, for use with Visual Studio 2012. Watch the Windows Embedded Newsroom for future updates on release plans.