Configuration File Settings for the .NET Compact Framework

The .NET Compact Framework supports a subset of the configuration file settings that are supported on the desktop. The configuration file settings can be included in the application configuration file or in the device configuration file. 

When present, the application configuration file must be in the same folder as the application executable itself, and must conform to the following naming convention: applicationname.exe.config. This file controls the configuration of the application.

When present, the device configuration file must be named device.config and stored in the \Windows directory. This file controls the configuration of the device.

The values you set in the device configuration file are global and apply to all applications. However, if you include a corresponding element in an application configuration file, its value overrides the value in the device configuration file.

The following table shows the supported configuration file settings.

Note

The <publisherPolicy> element is not supported.

Element

Definition

<supportedRuntime>

Specifies the runtime version of the .NET Compact Framework for the application or device to use. For example, you can force an application that was built with the .NET Compact Framework version 1.0 to run on a device that was installed with the .NET Compact Framework 2.0.

Note

You can also programmatically use an Environment object to determine the runtime version.

<bindingRedirect>

Specifies the assembly version to which an application binds, which might be a newer or older assembly against which an application is built.

<compatibilityVersion>

Specifies the compatibility mode for the application to use. When you use this element, the runtime invokes behavior from a specified version of the runtime. By default, the compatibility mode for an application is set to the version of the .NET Compact Framework with which it was built. In most scenarios, this setting is used only for diagnostic purposes. This element is supported only on the .NET Compact Framework.

The following table shows the version of the .NET Compact Framework in which support for the specified setting was added.

Element

Application configuration support

Device configuration support

<supportedRuntime>

2.0

3.5

<bindingRedirect>

2.0

2.0 SP2

<compatibilityVersion>

2.0

Not supported.

See Also

Tasks

How to: Configure Runtime Version

Other Resources

Building Applications and Core Tasks in the .NET Compact Framework

Change History

Date

History

Reason

October 2008

Added more information about compatibilityVersion element.

Information enhancement.