Share via


RequiresProvidesDirectiveProcessor.GetReferencesForProcessingRun Method

Gets references to pass to the compiler of the generated transformation class.

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

Syntax

'Declaration
Public Overrides Function GetReferencesForProcessingRun As String()
public override string[] GetReferencesForProcessingRun()
public:
virtual array<String^>^ GetReferencesForProcessingRun() override
abstract GetReferencesForProcessingRun : unit -> string[] 
override GetReferencesForProcessingRun : unit -> string[] 
public override function GetReferencesForProcessingRun() : String[]

Return Value

Type: array<System.String[]
An array of type String that contains the references.

Exceptions

Exception Condition
InvalidOperationException

A processing run has already started but not yet finished.

Remarks

To compile successfully, the code that the directive processor adds to the generated transformation class might require particular assemblies. The directive processor should add references to the required assemblies in this method.

To expose the code that is generated by the directive processor to the generated transformation class, the directive processor should add its assembly to the list of references.

Examples

The following example gets the set of extra assemblies that must be referenced to compile the code that this directive processor generates. This code example is part of a larger example that is provided for the RequiresProvidesDirectiveProcessor class.

public override string[] GetReferencesForProcessingRun()
{
List<string> references = new List<string>();
references.AddRange(base.GetReferencesForProcessingRun());
references.Add("System.Xml");
return references.ToArray();
}

.NET Framework Security

See Also

Reference

RequiresProvidesDirectiveProcessor Class

Microsoft.VisualStudio.TextTemplating Namespace

GetImportsForProcessingRun

GetClassCodeForProcessingRun

GetReferencesForProcessingRun