ITextTemplatingEngineHost.StandardAssemblyReferences Property

Gets a list of assembly references.

Namespace:  Microsoft.VisualStudio.TextTemplating
Assembly:  Microsoft.VisualStudio.TextTemplating (in Microsoft.VisualStudio.TextTemplating.dll)

Syntax

'宣言
ReadOnly Property StandardAssemblyReferences As IList(Of String)
'使用
Dim instance As ITextTemplatingEngineHost
Dim value As IList(Of String)

value = instance.StandardAssemblyReferences
IList<string> StandardAssemblyReferences { get; }
property IList<String^>^ StandardAssemblyReferences {
    IList<String^>^ get ();
}
function get StandardAssemblyReferences () : IList<String>

Property Value

Type: System.Collections.Generic.IList<String>

An IList that contains assembly names.

Remarks

Allows a host to specify standard assemblies to be referenced by the generated transformation class (for example, System.dll). The engine uses these references when it compiles and executes the generated transformation class.

Examples

The following code example shows a possible implementation for a custom host. This code example is part of a larger example provided for the ITextTemplatingEngineHost interface.

public IList<string> StandardAssemblyReferences
{
    get
    {
        return new string[]
        {
            //if this host searches standard paths and the GAC
            //we can specify the assembly name like this
            //---------------------------------------------------------
            //"System"

            //because this host only resolves assemblies from the 
            //fully qualified path and name of the assembly
            //this is a quick way to get the code to give us the
            //fully qualified path and name of the System assembly
            //---------------------------------------------------------
            typeof(System.Uri).Assembly.Location
        };
    }
}
Public ReadOnly Property StandardAssemblyReferences() As IList(Of String) Implements Microsoft.VisualStudio.TextTemplating.ITextTemplatingEngineHost.StandardAssemblyReferences
    Get
        'if this host searches standard paths and the GAC
        'we can specify the assembly name like this
        '---------------------------------------------------------
        'Return New String() {"System"}

        'because this host only resolves assemblies from the 
        'fully qualified path and name of the assembly
        'this is a quick way to get the code to give us the
        'fully qualified path and name of the System assembly
        '---------------------------------------------------------
        Return New String() {(New System.UriBuilder()).GetType().Assembly.Location}
    End Get
End Property

Permissions

See Also

Concepts

About Text Template Hosts

Walkthrough: Creating a Custom Text Template Host

Generating Artifacts Using Text Templates

Reference

ITextTemplatingEngineHost Interface

ITextTemplatingEngineHost Members

Microsoft.VisualStudio.TextTemplating Namespace