다음을 통해 공유


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 파일은 확장을 설치하는 데 사용됩니다.

다음 예제에서는 AssemblyInfo.cs 또는 AssemblyInfo.vb 파일의 항목을 보여줍니다 ProvideBindingRedirection .

[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 업데이트가 필요한지 여부를 나타냅니다. 이면 trueGUID 업데이트가 필요합니다. (기본값)이면 false 업데이트가 필요하지 않습니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)

속성

AssemblyName

대상 어셈블리의 이름입니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
CodeBase

$PackageFolder$의 상대 경로 또는 환경 변수 대체(형식: %variable%)에서 루팅된 절대 경로입니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
Culture

어셈블리의 언어 및 국가/지역을 지정하는 문자열입니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
CurrentAssembly

생성된 dependentAssembly 레지스트리 항목이 참조하는 어셈블리를 가져오거나 설정합니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
GenerateCodeBase

false이면 리디렉션된 어셈블리에 대해 해당 CodeBase 요소가 생성되지 않습니다(GAC의 어셈블리에 사용됨).

Guid

이 특성 instance 식별자입니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
NewVersion

원래 요청된 버전 대신 사용할 어셈블리의 버전을 지정합니다.

OldVersion

리디렉션될 버전 범위입니다. 직접 설정하지 않고 및 OldVersionUpperBound을 설정 OldVersionLowerBound 하여 구성됩니다.

OldVersionLowerBound

리디렉션될 버전 범위의 하한(포함)을 지정합니다.

OldVersionUpperBound

리디렉션될 버전 범위의 상한(포함)을 지정합니다.

PublicKeyToken

리디렉션되는 어셈블리의 강력한 이름의 토큰 부분인 16자 16진수입니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
TypeId

RegistrationAttribute 파생 클래스가 System.ComponentModel.TypeDescriptor.GetAttributes(...)에서 작동하도록 하려면 TypeID 속성을 재정의합니다. 이 속성에서 파생된 특성은 클래스에 적용할 수 있는 인스턴스에 대한 더 나은 제어가 필요한 경우에만 이 속성을 재정의해야 합니다.

(다음에서 상속됨 RegistrationAttribute)

메서드

FormatPublicKeyToken(Byte[])

이진 공개 키 토큰을 16진수 문자열로 서식을 지정합니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
GetGuidHashString()

특성의 ID로 해시될 문자열을 가져옵니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
GetPackageRegKeyPath(Guid)

VSPackage의 레지스트리 경로(애플리케이션의 레지스트리 루트를 기준으로)를 가져옵니다.

(다음에서 상속됨 RegistrationAttribute)
GetPathToKey()

키에 대한 경로를 가져옵니다. 이 특성의 값이 등록됩니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
Register(RegistrationAttribute+RegistrationContext)

지정된 컨텍스트에 이 특성을 등록합니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
SetValues(RegistrationAttribute+Key)

지정된 키에서 이 특성에 의해 처리되는 값을 설정합니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
TryParseVersion(String, Version)

문자열을 버전으로 구문 분석해 보세요. Version.TryParse와 달리 이 메서드는 빌드 및 수정 버전 번호를 선택적으로 고려하는 것이 아니라 입력이 4개의 숫자로 구성되도록 합니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
Unregister(RegistrationAttribute+RegistrationContext)

이 특성을 등록 취소합니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
UpdateAssemblyInformation()

이 특성이 적용되는 어셈블리에서 제공되지 않은 모든 정보를 업데이트합니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)
ValidateAttributeInformation()

필요한 모든 정보가 있는지 확인합니다.

(다음에서 상속됨 ProvideDependentAssemblyAttribute)

적용 대상