Partilhar via


ProjectGraph.ProjectInstanceFactoryFunc Delegate

Definition

A callback used for constructing a ProjectInstance for a specific ProjectGraphEntryPoint instance.

public: delegate Microsoft::Build::Execution::ProjectInstance ^ ProjectGraph::ProjectInstanceFactoryFunc(System::String ^ projectPath, Dictionary<System::String ^, System::String ^> ^ globalProperties, ProjectCollection ^ projectCollection);
public delegate Microsoft.Build.Execution.ProjectInstance ProjectGraph.ProjectInstanceFactoryFunc(string projectPath, Dictionary<string,string> globalProperties, ProjectCollection projectCollection);
type ProjectGraph.ProjectInstanceFactoryFunc = delegate of string * Dictionary<string, string> * ProjectCollection -> ProjectInstance
Public Delegate Function ProjectGraph.ProjectInstanceFactoryFunc(projectPath As String, globalProperties As Dictionary(Of String, String), projectCollection As ProjectCollection) As ProjectInstance 

Parameters

projectPath
String

The path to the project file to parse.

globalProperties
Dictionary<String,String>

The global properties to be used for creating the ProjectInstance.

projectCollection
ProjectCollection

The ProjectCollection context for parsing.

Return Value

A ProjectInstance instance. This value must not be null.

Remarks

The default version of this delegate used by ProjectGraph simply calls the ProjectInstance constructor with information from the parameters. This delegate is provided as a hook to allow scenarios like creating a Project instance before converting it to a ProjectInstance for use by the ProjectGraph. The returned ProjectInstance will be stored and provided with the ProjectGraph. If this callback chooses to generate an immutable ProjectInstance, e.g. by using CreateProjectInstance() with the flag Immutable, the resulting ProjectGraph nodes might not be buildable. To avoid corruption of the graph and subsequent builds based on the graph: - all callback parameters must be utilized for creating the ProjectInstance, without any mutations - the project instance should not be mutated in any way, its state should be a full fidelity representation of the project file

Applies to