DataProviderObjectFactory.GetAssembly Method
Resolves a provider-specific assembly string to its corresponding Assembly representation.
Namespace: Microsoft.VisualStudio.Data.Framework
Assembly: Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)
Syntax
'宣言
Public Overridable Function GetAssembly ( _
assemblyString As String _
) As Assembly
'使用
Dim instance As DataProviderObjectFactory
Dim assemblyString As String
Dim returnValue As Assembly
returnValue = instance.GetAssembly(assemblyString)
public virtual Assembly GetAssembly(
string assemblyString
)
public:
virtual Assembly^ GetAssembly(
String^ assemblyString
)
public function GetAssembly(
assemblyString : String
) : Assembly
Parameters
assemblyString
Type: System.StringA provider-specific assembly string.
Return Value
Type: System.Reflection.Assembly
An Assembly object representing the assembly resolved from the specified assembly string, if found; otherwise, a null reference (Nothing in Visual Basic).
Implements
IVsDataProviderObjectFactory.GetAssembly(String)
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The assemblyString parameter is a null reference (Nothing in Visual Basic). |
Remarks
This method is useful when there are assembly names specified as strings in formats like a data support XML file, and these assembly names cannot be automatically resolved (or would be resolved incorrectly) by the CLR’s Load method. One use of this method is to expand an incomplete assembly declaration. (For example, if the string is "MyAssembly", it might get expanded to "MyAssembly, Version=2.0.0.0, Culture=neutral, PublicKeyToken=1234567890ABCDEF" before the CLR resolves it.)
This method is provided to shorten a provider’s specification of type names, which can help reduce duplication of a commonly used assembly throughout the code base.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
DataProviderObjectFactory Class