다음을 통해 공유


TypeLibVersionAttribute 클래스

내보낸 형식 라이브러리의 버전 번호를 지정합니다.

네임스페이스: System.Runtime.InteropServices
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
<ComVisibleAttribute(True)> _
<AttributeUsageAttribute(AttributeTargets.Assembly, Inherited:=False)> _
Public NotInheritable Class TypeLibVersionAttribute
    Inherits Attribute
‘사용 방법
Dim instance As TypeLibVersionAttribute
[ComVisibleAttribute(true)] 
[AttributeUsageAttribute(AttributeTargets.Assembly, Inherited=false)] 
public sealed class TypeLibVersionAttribute : Attribute
[ComVisibleAttribute(true)] 
[AttributeUsageAttribute(AttributeTargets::Assembly, Inherited=false)] 
public ref class TypeLibVersionAttribute sealed : public Attribute
/** @attribute ComVisibleAttribute(true) */ 
/** @attribute AttributeUsageAttribute(AttributeTargets.Assembly, Inherited=false) */ 
public final class TypeLibVersionAttribute extends Attribute
ComVisibleAttribute(true) 
AttributeUsageAttribute(AttributeTargets.Assembly, Inherited=false) 
public final class TypeLibVersionAttribute extends Attribute

설명

이 특성을 어셈블리에 적용할 수 있습니다.

기본적으로 형식 라이브러리 내보내기(Tlbexp.exe)는 어셈블리 버전의 처음 두 번호에서 형식 라이브러리 버전을 생성합니다. 예를 들어, Tlb.exe는 어셈블리 버전 1.2.5000.0을 내보낼 때 어셈블리의 빌드 번호와 수정 번호를 제거하고 형식 라이브러리 버전 1.2로 내보냅니다. 명시적으로 TypeLibVersionAttribute를 적용하여 형식 라이브러리 번호 생성을 제어할 수도 있습니다.

두 어셈블리 버전이 같은 형식 라이브러리 버전을 만들 경우에는 형식 라이브러리 버전 생성을 명시적으로 제어하는 것이 좋습니다. 예를 들어, 어셈블리 버전 1.2.0.0과 1.2.500.0은 둘 다 형식 라이브러리 버전 1.2를 만듭니다. 이 경우 어셈블리 중 하나를 제거할 때 문제가 발생할 수 있습니다. 두 번째 어셈블리(버전 1.2.500.0)가 형식 라이브러리 버전 1.25를 만들도록 하여 두 형식 라이브러리 버전이 구별되도록 할 수 있습니다.

예제

다음 예제에서는 TypeLibVersionAttribute를 적용하여 형식 라이브러리 버전을 명시적으로 1.25로 설정하는 방법을 보여 줍니다.

Imports System
 Imports System.Runtime.Interop
 <Assembly: AssemblyVersion ("1.2.500.0")>
 <Assembly: TypeLibVersionAttribute(1,25)>
 Module MyNamespace
   Public Class c
     ' Insert code.
   End Class
using System;
 using System.Runtime.InteropServices;
 [Assembly: AssemblyVersion ("1.2.500.0")>
 [Assembly: TypeLibVersion(1,25)]
 namespace MyNamespace
 {
   class MyClass
   {
     // Insert code.
   }
 }

상속 계층 구조

System.Object
   System.Attribute
    System.Runtime.InteropServices.TypeLibVersionAttribute

스레드로부터의 안전성

이 형식의 모든 public static(Visual Basic의 경우 Shared) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

플랫폼

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1에서 지원

참고 항목

참조

TypeLibVersionAttribute 멤버
System.Runtime.InteropServices 네임스페이스

기타 리소스

형식 라이브러리 내보내기(Tlbexp.exe)