Export (0) Print
Expand All

Version Numbers for Main and Localized Satellite Assemblies

The main assembly uses versioning to determine whether to load resources. The SatelliteContractVersionAttribute class provides versioning support for a main assembly. Specifying the SatelliteContractVersionAttribute on an application's main assembly allows you to update and re-deploy a main assembly without updating its satellite assemblies. For your localized resources to be available, the satellite contract version of your main assembly must match the AssemblyVersionAttribute class of your satellite assemblies. You must specify an exact version number in the SatelliteContractVersionAttribute; wildcard characters such as "*" are not allowed. For more information, see Retrieving Resources in Satellite Assemblies.

The SatelliteContractVersionAttribute class allows you to update a main assembly without having to update your satellite assembly, or vice versa. When the main assembly is updated, its assembly version number is changed. If you want to continue using the existing satellite assemblies, change the main assembly's version number but leave the satellite contract version number the same. For example, in your first release your main assembly version may be 1.0.0.0. The satellite contract version and the assembly version of the satellite assembly will also be 1.0.0.0. If you need to update your main assembly for a service pack, you can change the assembly version to 1.0.0.1, while keeping the satellite contract version and the satellite's assembly version as 1.0.0.0.

If you need to update a satellite assembly but not your main assembly, you change the AssemblyVersionAttribute of the satellite assembly. Along with your satellite assembly, you will have to ship a policy assembly that states that your new satellite assembly is compatible with your old satellite assembly. For more information on policies, see How the Runtime Locates Assemblies.

The following code shows how to set the satellite contract version. The code can be placed in either a build script or in the AssemblyInfo.vb or AssemblyInfo.cs file.

' Visual Basic
<Assembly: SatelliteContractVersionAttribute("4.3.2.1")>

// C#
[assembly: SatelliteContractVersionAttribute("4.3.2.1")]

See Also

How the Runtime Locates Assemblies | Setting Assembly Attributes | Security and Localized Satellite Assemblies | Localizing Applications | Globalizing and Localizing Applications

Show:
© 2014 Microsoft