ProvideCodeBaseAttribute Class
Registers a set of values that define a dependent assembly tag with a code base. These values are merged at startup into the CLR runtime configuration.
Assembly: Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)
System.Attribute
Microsoft.VisualStudio.Shell.RegistrationAttribute
Microsoft.VisualStudio.Shell.ProvideDependentAssemblyAttribute
Microsoft.VisualStudio.Shell.ProvideCodeBaseAttribute
| Name | Description | |
|---|---|---|
![]() | ProvideCodeBaseAttribute() | Initializes a new instance of the ProvideCodeBaseAttribute class. |
| Name | Description | |
|---|---|---|
![]() | AssemblyName | Gets or sets the name of the target assembly.(Inherited from ProvideDependentAssemblyAttribute.) |
![]() | 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 | Gets or sets a string that specifies the language and country/region of the assembly.(Inherited from ProvideDependentAssemblyAttribute.) |
![]() | Guid | Gets the identifier of this attribute instance.(Inherited from ProvideDependentAssemblyAttribute.) |
![]() | 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 | Gets the current instance of this attribute.(Inherited from RegistrationAttribute.) |
![]() | Version | Gets or sets the version of the assembly to use instead of the originally-requested version. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | (Inherited from Attribute.) |
![]() | GetHashCode() | (Inherited from Attribute.) |
![]() | GetType() | (Inherited from Object.) |
![]() | IsDefaultAttribute() | (Inherited from Attribute.) |
![]() | Match(Object) | (Inherited from Attribute.) |
![]() | Register(RegistrationAttribute.RegistrationContext) | Registers this attribute with the given context.(Inherited from ProvideDependentAssemblyAttribute.) |
![]() | ToString() | (Inherited from Object.) |
![]() | Unregister(RegistrationAttribute.RegistrationContext) | Unregisters this attribute.(Inherited from ProvideDependentAssemblyAttribute.) |
| Name | Description | |
|---|---|---|
![]() ![]() | _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() | _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() | _Attribute.GetTypeInfoCount(UInt32) | (Inherited from Attribute.) |
![]() ![]() | _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) | (Inherited from Attribute.) |
By using the ProvideCodeBase attribute, you can specify a code base for an assembly in an extension without manually updating the exe.config file. This attribute indicates the location of the assembly so that the CLR can find it.
Adding a ProvideCodeBase assembly attribute is an easy way to add a code base entry to the pkgdef file. The pkgdef file is used to install the extension.
The following example shows a ProvideCodeBase entry in the AssemblyInfo.cs or AssemblyInfo.vb file:
[assembly: ProvideCodeBase(AssemblyName = "ClassLibrary1", Version = "1.0.0.0", CodeBase = "$PackageFolder$\\ClassLibrary1.dll")]
When you build the project, the following entry is added to the pkgdef file:
[$RootKey$\RuntimeConfiguration\dependentAssembly\codeBase\{D5206E57-D855-61F6-3D7E-EF7F72D9FAA7}]
"name"="ClassLibrary1"
"publicKeyToken"=""
"culture"="neutral"
"version"="2.0.0.0"
"codeBase"="$PackageFolder$\ClassLibrary1.dll"
You can also add a codeBase entry directly to a pkgdef file.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.



