次の方法で共有


ProvideBindingRedirectionAttribute クラス

定義

この属性は、バインディング リダイレクトを定義する値のセットを登録します。 これらの値は起動時に CLR ランタイム構成にマージされます。

例: [$RootKey$\RuntimeConfiguration\dependentAssembly\bindingRedirection{5C48C732-5C7F-40f0-87A7-05C4F15BC8C3}] "Name"="AssemblyName" "PublicKeyToken "="19ab8cb7287f414" "Culture"="neutral" "CodeBase"="$PackageFolder$\AssemblyName.dll" "OldVersion"="1.0.0.0" "NewVersion"="2.0.0.0"

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
[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=true)>]
type ProvideBindingRedirectionAttribute = class
    inherit ProvideDependentAssemblyAttribute
Public NotInheritable Class ProvideBindingRedirectionAttribute
Inherits ProvideDependentAssemblyAttribute
継承
属性

注釈

属性を ProvideBindingRedirection 使用すると、拡張可能なコンポーネントへのアップグレードのインストールにバインド リダイレクトを指定できます。 拡張可能な Visual Studio コンポーネントを出荷する場合、この属性を使用すると、コンポーネントのユーザーが依存コンポーネントの古いバージョンをインストールする必要がなくなります。 属性を使用する ProvideBindingRedirection 場合は、古いアセンブリ バージョンのユーザーを新しいバージョンにリダイレクトするために、exe.config ファイルを手動で更新する必要はありません。

アセンブリ属性の ProvideBindingRedirection 追加は、バインド リダイレクト エントリを pkgdef ファイルに簡単に追加する方法です。 pkgdef ファイルは、拡張機能のインストールに使用されます。

次の例は、 ProvideBindingRedirection AssemblyInfo.cs または AssemblyInfo.vb ファイルのエントリを示しています。

[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")> 

プロジェクトがビルドされると、pkgdef ファイルに次のエントリが追加されます。

[$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"  

bindingRedirection エントリを pkgdef ファイルに直接追加することもできます。

コンストラクター

ProvideBindingRedirectionAttribute()

ProvideBindingRedirectionAttribute クラスの新しいインスタンスを初期化します。

フィールド

_guidUpdateNeeded

GUID の更新が必要かどうかを示します。 の場合 trueは、GUID の更新が必要です。 (既定値) の場合 false 、更新は必要ありません。

(継承元 ProvideDependentAssemblyAttribute)

プロパティ

AssemblyName

ターゲット アセンブリの名前。

(継承元 ProvideDependentAssemblyAttribute)
CodeBase

$PackageFolder$ からの相対パス、または環境変数の置換からルート化された絶対パス (形式: %variable%)。

(継承元 ProvideDependentAssemblyAttribute)
Culture

アセンブリの言語と国および地域を指定する文字列。

(継承元 ProvideDependentAssemblyAttribute)
CurrentAssembly

生成された dependentAssembly レジストリ エントリが参照するアセンブリを取得または設定します。

(継承元 ProvideDependentAssemblyAttribute)
GenerateCodeBase

false の場合、リダイレクトされたアセンブリ (GAC 内のアセンブリに使用) に対応する CodeBase 要素は生成されません。

Guid

この属性インスタンスの識別子。

(継承元 ProvideDependentAssemblyAttribute)
NewVersion

最初に要求されたバージョンの代わりに使用するアセンブリのバージョンを指定します。

OldVersion

リダイレクトされるバージョンの範囲。 直接設定されず、 と OldVersionUpperBoundを設定OldVersionLowerBoundして形成されます。

OldVersionLowerBound

リダイレクトされるバージョンの範囲の下限 (包括) を指定します。

OldVersionUpperBound

リダイレクトされるバージョンの範囲の上限 (包括的) を指定します。

PublicKeyToken

リダイレクトされるアセンブリの厳密な名前のトークン部分である 16 文字の 16 文字の 16 進数。

(継承元 ProvideDependentAssemblyAttribute)
TypeId

RegistrationAttribute 派生クラスが System.ComponentModel.TypeDescriptor.GetAttributes(...) と連携できるように、TypeID プロパティをオーバーライドします。このプロパティから派生した属性は、クラスに適用できるインスタンスをより適切に制御する必要がある場合にのみ、このプロパティをオーバーライドする必要があります。

(継承元 RegistrationAttribute)

メソッド

FormatPublicKeyToken(Byte[])

バイナリ公開キー トークンを 16 進文字列に書式設定します。

(継承元 ProvideDependentAssemblyAttribute)
GetGuidHashString()

属性の ID にハッシュされる文字列を取得します。

(継承元 ProvideDependentAssemblyAttribute)
GetPackageRegKeyPath(Guid)

VSPackage のレジストリ パス (アプリケーションのレジストリ ルートに対する相対パス) を取得します。

(継承元 RegistrationAttribute)
GetPathToKey()

Key へのパスを取得します。この属性の値が登録されます。

(継承元 ProvideDependentAssemblyAttribute)
Register(RegistrationAttribute+RegistrationContext)

この属性を指定されたコンテキストに登録します。

(継承元 ProvideDependentAssemblyAttribute)
SetValues(RegistrationAttribute+Key)

指定された Key でこの属性によって処理される値を設定します。

(継承元 ProvideDependentAssemblyAttribute)
TryParseVersion(String, Version)

文字列を Version に解析してみてください。 Version.TryParse とは異なり、このメソッドでは、ビルド番号とリビジョン番号を省略可能とするのではなく、入力が 4 つの数値で構成されます。

(継承元 ProvideDependentAssemblyAttribute)
Unregister(RegistrationAttribute+RegistrationContext)

この属性の登録を解除します。

(継承元 ProvideDependentAssemblyAttribute)
UpdateAssemblyInformation()

この属性が適用されているアセンブリから提供されていないすべての情報を更新します。

(継承元 ProvideDependentAssemblyAttribute)
ValidateAttributeInformation()

必要なすべての情報があることを確認します。

(継承元 ProvideDependentAssemblyAttribute)

適用対象