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.

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)


[AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple = true, 
	Inherited = true)]
public sealed class ProvideCodeBaseAttribute : ProvideDependentAssemblyAttribute

NameDescription
System_CAPS_pubmethodProvideCodeBaseAttribute()

Initializes a new instance of the ProvideCodeBaseAttribute class.

NameDescription
System_CAPS_pubpropertyAssemblyName

Gets or sets the name of the target assembly.(Inherited from ProvideDependentAssemblyAttribute.)

System_CAPS_pubpropertyCodeBase

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

System_CAPS_pubpropertyCulture

Gets or sets a string that specifies the language and country/region of the assembly.(Inherited from ProvideDependentAssemblyAttribute.)

System_CAPS_pubpropertyGuid

Gets the identifier of this attribute instance.(Inherited from ProvideDependentAssemblyAttribute.)

System_CAPS_pubpropertyPublicKeyToken

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.)

System_CAPS_pubpropertyTypeId

Gets the current instance of this attribute.(Inherited from RegistrationAttribute.)

System_CAPS_pubpropertyVersion

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

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Attribute.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Attribute.)

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodIsDefaultAttribute()

(Inherited from Attribute.)

System_CAPS_pubmethodMatch(Object)

(Inherited from Attribute.)

System_CAPS_pubmethodRegister(RegistrationAttribute.RegistrationContext)

Registers this attribute with the given context.(Inherited from ProvideDependentAssemblyAttribute.)

System_CAPS_pubmethodToString()

(Inherited from Object.)

System_CAPS_pubmethodUnregister(RegistrationAttribute.RegistrationContext)

Unregisters this attribute.(Inherited from ProvideDependentAssemblyAttribute.)

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.

Return to top
Show: