C Sharp

QFEs and the Default Version Policy

Quick Fix Engineering updates, or hot fixes, are unscheduled fixes that are sent out to address a major problem. Because a hot fix typically doesn't modify the code's interface, the chances that client code will be adversely affected are minimal. Therefore, the default versioning policy is to automatically associate all client code to the new "fixed" version of the code unless a configuration file exists for the application that explicitly associates the application with a specific version of an assembly. A new version of an assembly is considered to be a QFE if the only part of the version number that changed is the revision part.

Creating a Safe Mode Configuration File

This default version policy might be fine most of the time, but what if you need to specify that the Personalapplication run only with the version that it shipped with? This is where XML configuration files come in. These files have the same name as the application and reside in the same folder. When the application is executed, the configuration file is read and .NET then uses the XML tags therein to dictate which version of a referenced assembly to use.

To specify that an application should always use the version of an assembly that it shipped with, you specify that you want the application's binding mode to be "safe". This is sometimes colloquially referred to as putting the application in safe mode. To test this, create a file called PersonalAccounting.cfg in the Accounting/Personal folder and modify it such that it appears as follows. Take note of the <AppBindingMode> tag.

<?xml version ="1.0"?>
<Configuration>
<BindingMode>
<AppBindingMode Mode="safe"/>
</BindingMode>
</Configuration>

Now, if you run the Personalapplication again, you'll see the following output: -

PersonalAccounting calling Account.PrintVersion
This is version 1.0.0.0 of the Account class

by BrainBellupdated
Advertisement: