Partager via


Is your application running on version 2 of the .NET Compact Framework?

Now that version 2 of the .NET Compact Framework has been released and Visual Studio 2005 has been launched, I thought it would be a good idea to post an update to the application configuration (app.config) file needed to allow your .NET Compact Framework v1 applications to enjoy the benefits of the new release.

To promote your v1 applications to run on version 2 of the .NET Compact Framework,:

  1. Copy the following XML data
    <configuration>   <startup>     <supportedRuntime version="v2.0.5238"/>     <supportedRuntime version="v1.0.4292"/>     <supportedRuntime version="v1.0.3316"/>     <supportedRuntime version="v1.0.3111"/>     <supportedRuntime version="v1.0.2268"/>   </startup> </configuration>
  2. Create a file called <appname>.exe.config (ex: WebCrawler.exe.config) containing the above XML
  3. Save a copy of the file in the folder (on your device) containing your application (ex: \Program Files\Web Crawler)

By default, the .NET Compact Framework will run your application on the version of the runtime for which it was originally written.  Currently available (at the time of this writing) Windows Mobile 2003 and Windows Mobile 5.0 devices contain version 1 of the .NET Compact Framework in ROM.  Installing version 2 of the .NET Compact Framework does not overwrite or disable version 1.  In this scenario, your applications written for version 1 will continue to use version 1.

The addition of an application configuration file containing the above mentioned data will instruct the .NET Compact Framework to run your application with the specified version (version 2) of the runtime.  Your application will now take advantage of the performance improvements we have made in version 2 of the .NET Compact Framework.  Please note that since version 1 of the .NET Compact Framework is not aware of application configuration files, having one present on a device without version 2 installed has no affect on your application, it will continue to run with version 1.

While version 1 of the .NET Compact Framework is not application configuration file aware, installing and uninstalling version 2, on a device with version 1, will add configuration file awareness (via the updated mscoree.dll).  This is why the above data contains references to all .NET Compact Framework versions (v1, v1 SP1, v1 SP2, v1 SP3 and v2).

Compatibility is a primary goal for the .NET Compact Framework team.  If you encounter any issues running your version 1 applications using the above described application configuration file, please let us know via the Microsoft Product Feedback Center.

Take care,
-- DK

Disclaimer(s):
This posting is provided "AS IS" with no warranties, and confers no rights.

[Edit: add version 1 information to config file data]

Comments

  • Anonymous
    December 02, 2005
    How do I confirm that version 2.0 is actually being used? I do not perceive any obvious speed improvements. (I am assuming that Windows Mobile 2003 is the same as Pocket PC 2003.)

    Thanks,
    Nathan

  • Anonymous
    December 05, 2005
    The comment has been removed

  • Anonymous
    February 24, 2006
    I've talked before about application configuration file support in the .NET Compact Framework version...

  • Anonymous
    February 24, 2006
    Just a quick note for those of you who have already read my &quot;Is your application running on version 2...

  • Anonymous
    March 11, 2008
    By default, a managed device application is run with the version of the .Net Compact Framework it was

  • Anonymous
    March 11, 2008
    By default, a managed device application is run with the version of the .Net Compact Framework it was

  • Anonymous
    March 11, 2008
    PingBack from http://msdnrss.thecoderblogs.com/2008/03/11/promoting-all-net-compact-framework-applications-on-a-device-using-deviceconfig/