ProvideBindingRedirectionAttribute ProvideBindingRedirectionAttribute ProvideBindingRedirectionAttribute ProvideBindingRedirectionAttribute ProvideBindingRedirectionAttribute Class

Definition

Registers a set of values that define a binding redirection. These values are merged at startup into the CLR runtime configuration.

public ref class ProvideBindingRedirectionAttribute sealed : Microsoft::VisualStudio::Shell::ProvideDependentAssemblyAttribute
public ref class ProvideBindingRedirectionAttribute sealed : Microsoft::VisualStudio::Shell::ProvideDependentAssemblyAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=true)]
public sealed class ProvideBindingRedirectionAttribute : Microsoft.VisualStudio.Shell.ProvideDependentAssemblyAttribute
type ProvideBindingRedirectionAttribute = class
    inherit ProvideDependentAssemblyAttribute
Public NotInheritable Class ProvideBindingRedirectionAttribute
Inherits ProvideDependentAssemblyAttribute
Inheritance
Attributes

Remarks

By using the ProvideBindingRedirection attribute, you can specify binding redirection for the installation of an upgrade to an extensible component. When you ship an extensible Visual Studio component, this attribute prevents users of the component from having to install an old version of a dependent component. If you use the ProvideBindingRedirection attribute, you don't need to manually update the exe.config file to redirect users of the old assembly version to the new version.

Adding a ProvideBindingRedirection assembly attribute is an easy way to add a binding redirection entry to the pkgdef file. The pkgdef file is used to install the extension.

The following example shows a ProvideBindingRedirection entry in the AssemblyInfo.cs or AssemblyInfo.vb file:

[assembly: ProvideBindingRedirection(AssemblyName = "ClassLibrary1",
    NewVersion = "3.0.0.0", OldVersionLowerBound = "1.0.0.0",
    OldVersionUpperBound = "2.0.0.0")]
<Assembly: ProvideBindingRedirection(AssemblyName:="ClassLibrary1",
    NewVersion:="3.0.0.0", OldVersionLowerBound:="1.0.0.0",
    OldVersionUpperBound:="2.0.0.0")> 

When the project is built, the following entry is added to the pkgdef file:

[$RootKey$\RuntimeConfiguration\dependentAssembly\bindingRedirection\{EE3E8305-3E91-51CD-0B2D-8E8EFFDD081C}]  
"name"="ClassLibrary1"  
"publicKeyToken"=""  
"culture"="neutral"  
"oldVersion"="1.0.0.0-2.0.0.0"  
"newVersion"="3.0.0.0"  
"codeBase"="$PackageFolder$\ClassLibrary1.dll"  

You can also add a bindingRedirection entry directly to a pkgdef file.

Constructors

ProvideBindingRedirectionAttribute() ProvideBindingRedirectionAttribute() ProvideBindingRedirectionAttribute() ProvideBindingRedirectionAttribute() ProvideBindingRedirectionAttribute()

Initializes a new instance of the ProvideBindingRedirectionAttribute class.

Properties

AssemblyName AssemblyName AssemblyName AssemblyName AssemblyName

Gets or sets the name of the target assembly.

(Inherited from ProvideDependentAssemblyAttribute)
CodeBase CodeBase CodeBase CodeBase CodeBase

Gets or sets a relative path from $PackageFolder$, or an absolute path rooted from an environment variable substitution (of format %variable%).

(Inherited from ProvideDependentAssemblyAttribute)
Culture Culture Culture Culture Culture

Gets or sets a string that specifies the language and country/region of the assembly.

(Inherited from ProvideDependentAssemblyAttribute)
CurrentAssembly CurrentAssembly CurrentAssembly CurrentAssembly CurrentAssembly

Gets or sets the assembly to which the generated dependentAssembly registry entry refers.

(Inherited from ProvideDependentAssemblyAttribute)
GenerateCodeBase GenerateCodeBase GenerateCodeBase GenerateCodeBase GenerateCodeBase

Gets or sets the generated code base element. When false, no corresponding CodeBase element is generated for the redirected assembly (used for assemblies in the GAC).

Guid Guid Guid Guid Guid

Gets the identifier of this attribute instance.

(Inherited from ProvideDependentAssemblyAttribute)
NewVersion NewVersion NewVersion NewVersion NewVersion

Gets or sets the version of the assembly to use instead of the originally-requested version.

OldVersion OldVersion OldVersion OldVersion OldVersion

Gets the range of versions that will be redirected.

OldVersionLowerBound OldVersionLowerBound OldVersionLowerBound OldVersionLowerBound OldVersionLowerBound

Gets or sets the lower bound (inclusive) of the range of versions that will be redirected.

OldVersionUpperBound OldVersionUpperBound OldVersionUpperBound OldVersionUpperBound OldVersionUpperBound

Gets or sets the upper bound (inclusive) of the range of versions that will be redirected.

PublicKeyToken PublicKeyToken PublicKeyToken PublicKeyToken PublicKeyToken

Gets or sets a 16-character hexadecimal number which is the token part of the strong name of the assembly being redirected.

(Inherited from ProvideDependentAssemblyAttribute)
TypeId TypeId TypeId TypeId TypeId

Gets the current instance of this attribute.

(Inherited from RegistrationAttribute)

Fields

_guidUpdateNeeded _guidUpdateNeeded _guidUpdateNeeded _guidUpdateNeeded _guidUpdateNeeded

Indicates whether a GUID update is required. If true, a GUID update is required. If false (default), no update is required.

(Inherited from ProvideDependentAssemblyAttribute)

Methods

FormatPublicKeyToken(Byte[]) FormatPublicKeyToken(Byte[]) FormatPublicKeyToken(Byte[]) FormatPublicKeyToken(Byte[]) FormatPublicKeyToken(Byte[])

Formats a binary public key token into a hexadecimal string.

(Inherited from ProvideDependentAssemblyAttribute)
GetGuidHashString() GetGuidHashString() GetGuidHashString() GetGuidHashString() GetGuidHashString()

Gets the string that will be hashed into the identifier of the attribute.

(Inherited from ProvideDependentAssemblyAttribute)
GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid) GetPackageRegKeyPath(Guid)

Gets the registry path (relative to the registry root of the application) of the VSPackage.

(Inherited from RegistrationAttribute)
GetPathToKey() GetPathToKey() GetPathToKey() GetPathToKey() GetPathToKey()

Gets the path to the key were the values for this attribute will be registered.

(Inherited from ProvideDependentAssemblyAttribute)
Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext) Register(RegistrationAttribute+RegistrationContext)

Registers this attribute with the given context.

(Inherited from ProvideDependentAssemblyAttribute)
SetValues(RegistrationAttribute+Key) SetValues(RegistrationAttribute+Key) SetValues(RegistrationAttribute+Key) SetValues(RegistrationAttribute+Key) SetValues(RegistrationAttribute+Key)

Set values handled by this attribute in the given key.

(Inherited from ProvideDependentAssemblyAttribute)
TryParseVersion(String, Version) TryParseVersion(String, Version) TryParseVersion(String, Version) TryParseVersion(String, Version) TryParseVersion(String, Version)

Try to parse a string into a Version. Unlike Version.TryParse, this method ensures that the input consists of four numbers, as opposed to considering the build and revision numbers optional.

(Inherited from ProvideDependentAssemblyAttribute)
Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext) Unregister(RegistrationAttribute+RegistrationContext)

Unregisters this attribute.

(Inherited from ProvideDependentAssemblyAttribute)
UpdateAssemblyInformation() UpdateAssemblyInformation() UpdateAssemblyInformation() UpdateAssemblyInformation() UpdateAssemblyInformation()

Updates all information not provided from the assembly to which this attribute is applied.

(Inherited from ProvideDependentAssemblyAttribute)
ValidateAttributeInformation() ValidateAttributeInformation() ValidateAttributeInformation() ValidateAttributeInformation() ValidateAttributeInformation()

Validates that all the required information has been supplied.

(Inherited from ProvideDependentAssemblyAttribute)

Applies to