Per-application configuration redirects the dependence of a particular application from one version of a side-by-side assembly to another version of the assembly. A per-application configuration may become necessary if the correct operation of a particular application requires an assembly version that is different than the version normally specified as a default configuration or publisher configuration. For example, a global update of the assembly version by the publisher might fix the assembly but break this particular application. In this case, per-application configuration might be used to enable the application to continue to run with the previous assembly version.
Starting with Windows Server 2003, per-application configuration always overrides the default configuration on a per-application basis. Per-application configuration overrides publisher configuration on a per-application basis only if the application configuration file specifies apply="no" in publisherPolicy and there is a corresponding entry present in the Application Compatibility database.
Starting with Windows Server 2003, a per-application configuration will override a publisher configuration if the application configuration file specifies apply="yes" in publisherPolicy and the EnableAppConfig flag is set for the application in the Application Compatibility database. This capability to override a publisher configuration using a per-application configuration enables the application to be run in Safemode. For more information about the Application Compatibility database and Safemode, see the Windows Application Compatibility Toolkit. You can obtain the Windows Application Compatibility Toolkit from http://www.microsoft.com/downloads.
Application administrators can implement a per-application configuration by authoring and installing application configuration files and updating the application compatibility database. The application configuration file should then be deployed and installed into the same folder as the application's executable file. For a listing of the file schema, see Application Configuration File Schema. The application compatibility database must be distributed as described in the Application Compatibility Toolkit.
The following is an example of an application configuration file. For more information, see Application Configuration Files.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <configuration> <windows> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyIdentity processorArchitecture="X86" name="Microsoft.Windows.mysampleApp" type="win32" version="22.214.171.124"/> <publisherPolicy apply="no"/> <dependentAssembly> <assemblyIdentity type="win32" processorArchitecture="x86" name="Microsoft.Windows.SampleAssembly" publicKeyToken="0000000000000000"/> <bindingRedirect oldVersion="126.96.36.199" newVersion="188.8.131.52"/> </dependentAssembly> </assemblyBinding> </windows> </configuration>
The application administrator should add the required entries to the Application Compatibility database. Download and install the Windows Application Compatibility Toolkit 2.6 from http://www.microsoft.com/downloads. Create a new custom or update your existing database using the Compatibility Administrator as outlined in the toolkit. The Compatibility Fix you want to choose for the compatibility layer for your application is EnableAppConfig. You must always test applications before installing a new compatibility database.