Share via


IVsaReferenceItem.AssemblyName Property

Gets or sets the name of the referenced assembly.

public: _property String* get_AssemblyName(); 
public: _property set_AssemblyName(String* value);
public string AssemblyName { get; set; }
Property Get AssemblyName() As String 
Public Property Let AssemblyName( _ 
   ByVal value As String)

Return Value

Returns the string literal name of the referenced assembly.

Remarks

All assemblies that are referenced by a project, but that are not part of the Microsoft .NET Framework, must be placed in the Application Base directory. You can reference the Application Base directory by setting the ApplicationBase property using the IVsaEngine.SetOption method.

Note

Only Visual Basic .NET uses the ApplicationBase property. JScript .NET can take the full path name to the assembly for its AssemblyName property. In both cases, however, the AssemblyName value is only used at compile time. At runtime, the .NET Framework loader (Fusion) searches for assemblies in a specific order, as described in How the Runtime Locates Assemblies. For more information about how the runtime uses file paths, see System.AppDomainSetup.

In addition to the errors noted below, the AssemblyExpected exception may be thrown when the IVsaEngine.Compile method is called if the AssemblyName property does not refer to a valid assembly.

The default value is the empty string ("""").

Because references require access to the file system in order to load the assembly DLL, System.Security.Permission.FileIOPermission is required to access this property.

The following table shows the exceptions that the AssemblyName property can throw.

Exception Type

Condition

EngineClosed

The IVsaEngine.Close method has been called and the engine is closed.

EngineRunning

The engine is running.

EngineBusy

The engine is currently servicing requests on another thread.

AssemblyNameInvalid

The assembly name is not valid.

See Also

Reference

IVsaEngine.SetOption Method

IVsaEngine.Compile Method

IVsaReferenceItem Interface

System.AppDomainSetup

Concepts

How the Runtime Locates Assemblies