65 instantiations of ProjectInstance
dotnet (4)
Commands\Reference\List\ReferenceListCommand.cs (1)
41ProjectInstance projectInstance = new(msbuildProj.ProjectRootElement);
Commands\Solution\Add\SolutionAddCommand.cs (1)
160ProjectInstance projectInstance = new ProjectInstance(projectRootElement);
Commands\Workload\Restore\WorkloadRestoreCommand.cs (1)
79var project = new ProjectInstance(projectFile, globalProperties, null);
ReleasePropertyProjectLocator.cs (1)
254return new ProjectInstance(projectPath, globalProperties, "Current");
Microsoft.Build (15)
BackEnd\BuildManager\BuildManager.cs (1)
1992return new ProjectInstance(
BackEnd\Shared\BuildRequestConfiguration.cs (1)
489return new ProjectInstance(
Construction\Solution\SolutionProjectGenerator.cs (2)
990var traversalInstance = new ProjectInstance( 1227ProjectInstance metaprojectInstance = new ProjectInstance(EscapingUtilities.UnescapeAll(GetMetaprojectName(project)), traversalProject, GetMetaprojectGlobalProperties(traversalProject));
Definition\Project.cs (1)
3727return new ProjectInstance(_data, DirectoryPath, FullPath, ProjectCollection.HostServices, ProjectCollection.EnvironmentProperties, settings);
Graph\ProjectGraph.cs (1)
855return new ProjectInstance(
Instance\ProjectInstance.cs (9)
198/// of another ProjectInstance. <seealso cref="ProjectInstance(ProjectInstance, bool, RequestedProjectState)"/> 920return new ProjectInstance( 939return new ProjectInstance( 959return new ProjectInstance(project, fastItemLookupNeeded); 1309/// of another ProjectInstance. <seealso cref="ProjectInstance(ProjectInstance, bool, RequestedProjectState)"/> 2146return new ProjectInstance(this, true, filter); 2162return new ProjectInstance(this, isImmutable); 2751return new ProjectInstance(translator); 3093ProjectInstance instance = new(projectRootElement, globalProperties, toolsVersion, buildParameters, loggingService, projectBuildEventContext, sdkResolverService, submissionId);
Microsoft.Build.Engine.OM.UnitTests (10)
Definition\Project_Tests.cs (4)
681ProjectInstance projectInstance = new ProjectInstance(xml); 719ProjectInstance projectInstance = new ProjectInstance(xml); 755ProjectInstance projectInstance = new ProjectInstance(xml); 793ProjectInstance projectInstance = new ProjectInstance(xml);
Instance\ProjectInstance_Tests.cs (5)
345ProjectInstance instance = new ProjectInstance(ProjectRootElement.Create()); 357ProjectInstance instance = new ProjectInstance(ProjectRootElement.Create()); 369ProjectInstance instance = new ProjectInstance(ProjectRootElement.Create()); 382ProjectInstance instance = new ProjectInstance(xml); 469var projBInstance = new ProjectInstance(projBEval, ProjectInstanceSettings.ImmutableWithFastItemLookup);
Instance\ProjectItemInstance_Tests.cs (1)
1166ProjectInstance project = new ProjectInstance(xml);
Microsoft.Build.Engine.UnitTests (36)
BackEnd\BuildManager_Tests.cs (1)
3659return new ProjectInstance(rootProject);
BackEnd\IntrinsicTask_Tests.cs (1)
3541ProjectInstance instance = new ProjectInstance(xml);
BackEnd\ResultsCache_Tests.cs (1)
311resultForRequestWithSubsetFlag1.ProjectStateAfterBuild = new ProjectInstance(ProjectRootElement.Create(xmlReader)).FilteredCopy(requestedProjectState1);
BackEnd\TaskHost_Tests.cs (1)
78configuration.Project = new ProjectInstance(ProjectRootElement.Create());
BackEnd\TaskHostFactory_Tests.cs (3)
68ProjectInstance projectInstance = new(project.Path); 140ProjectInstance projectInstance = new(project.Path); 293ProjectInstance projectInstance = new(project.ProjectFile);
Definition\ToolsVersion_Tests.cs (2)
791ProjectInstance pi = new ProjectInstance(projectFromString.Project.Xml, null /* no global properties */, null /* don't explicitly set the toolsversion */, p); 901ProjectInstance pi = new ProjectInstance(projectFromString.Project.Xml, null /* no global properties */, null /* don't explicitly set the toolsversion */, p);
Evaluation\Evaluator_Tests.cs (1)
484ProjectInstance project = new ProjectInstance(subdirProjPath);
Evaluation\Expander_Tests.cs (9)
4823ProjectInstance projectInstance = new ProjectInstance(projectFile.Path); 4867ProjectInstance projectInstance = new ProjectInstance(projectFile.Path); 4896ProjectInstance projectInstance = new ProjectInstance(projectFile.Path); 4943ProjectInstance projectInstance = new ProjectInstance(projectFile.Path); 4984ProjectInstance projectInstance = new ProjectInstance(projectFile.Path); 5018ProjectInstance projectInstance = new ProjectInstance(projectFile.Path); 5064new ProjectInstance(projectFile.Path); 5105new ProjectInstance(projectFile.Path); 5137new ProjectInstance(projectFile.Path);
ExpressionTree_Tests.cs (6)
183ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create()); 213ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create()); 248ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create()); 280ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create()); 297ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create()); 326ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create());
ExpressionTreeExpression_Tests.cs (1)
374ProjectInstance parentProject = new ProjectInstance(xml);
Instance\ProjectInstance_Internal_Tests.cs (10)
288var projectInstance = new ProjectInstance( 425ProjectInstance p = new ProjectInstance(xml, globalProperties, ObjectModelHelpers.MSBuildDefaultToolsVersion, "ABCDEF", collection); 691var original = new ProjectInstance(rootElement); 708(f, xml, c) => new ProjectInstance(f, null, null, c) 726(f, xml, c) => new ProjectInstance(f, null, null, c).DeepCopy() 732(f, xml, c) => new ProjectInstance(xml, null, null, c) 746var pi = new ProjectInstance(f, null, null, c); 784ProjectInstance projectInstance = new ProjectInstance(rootElement); 820ProjectInstance projectInstance = new ProjectInstance(rootElement); 865? new ProjectInstance(rootElement, globalProperties: null, toolsVersion: null, buildParameters, projectCollection.LoggingService, buildEventContext, sdkResolverService: null, 0)
722 references to ProjectInstance
dotnet (41)
Commands\Package\Add\PackageAddCommand.cs (1)
192var projectInstance = command.CreateProjectInstance(projectCollection);
Commands\Project\Convert\ProjectConvertCommand.cs (1)
122var projectInstance = command.CreateProjectInstance(projectCollection);
Commands\Reference\List\ReferenceListCommand.cs (1)
41ProjectInstance projectInstance = new(msbuildProj.ProjectRootElement);
Commands\Run\RunCommand.cs (10)
125Func<ProjectCollection, ProjectInstance>? projectFactory = null; 304private void EnsureProjectIsBuilt(out Func<ProjectCollection, ProjectInstance>? projectFactory, out RunProperties? cachedRunProperties, out VirtualProjectBuildingCommand? virtualCommand) 384internal ICommand GetTargetCommand(Func<ProjectCollection, ProjectInstance>? projectFactory, RunProperties? cachedRunProperties) 405var project = EvaluateProject(ProjectFileFullPath, projectFactory, MSBuildArgs, logger); 413static ProjectInstance EvaluateProject(string? projectFilePath, Func<ProjectCollection, ProjectInstance>? projectFactory, MSBuildArgs msbuildArgs, ILogger? binaryLogger) 430static void ValidatePreconditions(ProjectInstance project) 483static void InvokeRunArgumentsTarget(ProjectInstance project, bool noBuild, FacadeLogger? binaryLogger, MSBuildArgs buildArgs) 500internal static void ThrowUnableToRunError(ProjectInstance project) 842var project = collection.LoadProject(ProjectFileFullPath).CreateProjectInstance();
Commands\Run\RunProperties.cs (1)
22internal static RunProperties FromProject(ProjectInstance project)
Commands\Run\RunTelemetry.cs (2)
192public static int CountPackageReferences(ProjectInstance project) 202public static int CountProjectReferences(ProjectInstance project)
Commands\Run\VirtualProjectBuildingCommand.cs (6)
313ProjectInstance? projectInstance = null; 447void TryCacheCscArguments(CacheInfo cache, BuildResult result, ProjectInstance projectInstance) 505void PrintBuildInformation(ProjectCollection projectCollection, ProjectInstance projectInstance, BuildResult? buildOrRestoreResult) 1040public ProjectInstance CreateProjectInstance(ProjectCollection projectCollection) 1045private ProjectInstance CreateProjectInstance( 1058return ProjectInstance.FromProjectRootElement(projectRoot, new ProjectOptions
Commands\Solution\Add\SolutionAddCommand.cs (1)
160ProjectInstance projectInstance = new ProjectInstance(projectRootElement);
Commands\Test\MTP\SolutionAndProjectUtility.cs (5)
180private static ProjectInstance EvaluateProject(ProjectCollection collection, EvaluationContext evaluationContext, string projectFilePath, string? tfm) 204return ProjectInstance.FromFile(projectFilePath, new ProjectOptions 222ProjectInstance projectInstance = EvaluateProject(projectCollection, evaluationContext, projectFilePath, null); 290private static TestModule? GetModuleFromProject(ProjectInstance project, BuildOptions buildOptions) 348static RunProperties GetRunProperties(ProjectInstance project)
Commands\Workload\Restore\WorkloadRestoreCommand.cs (1)
79var project = new ProjectInstance(projectFile, globalProperties, null);
Extensions\ProjectInstanceExtensions.cs (4)
10public static string GetProjectId(this ProjectInstance projectInstance) 19public static string GetDefaultProjectTypeGuid(this ProjectInstance projectInstance) 29public static IEnumerable<string> GetPlatforms(this ProjectInstance projectInstance) 37public static IEnumerable<string> GetConfigurations(this ProjectInstance projectInstance)
ReleasePropertyProjectLocator.cs (8)
78ProjectInstance? project = GetTargetedProject(globalProperties); 109public ProjectInstance? GetTargetedProject(ReadOnlyDictionary<string, string>? globalProps) 148public ProjectInstance? GetArbitraryProjectFromSolution(string slnPath, ReadOnlyDictionary<string, string>? globalProps) 166List<ProjectInstance> configuredProjects = []; 184var projectData = TryGetProjectInstance(projectFullPath, globalProps); 218private ProjectInstance? GetSingleProjectFromSolution(SolutionModel sln, string slnPath, ReadOnlyDictionary<string, string>? globalProps) 228var projectData = TryGetProjectInstance(projectFullPath, globalProps); 250private static ProjectInstance? TryGetProjectInstance(string projectPath, ReadOnlyDictionary<string, string>? globalProperties)
dotnet-watch (3)
Build\EvaluationResult.cs (1)
94var projectInstance = project.ProjectInstance.DeepCopy();
Build\ProjectGraphUtilities.cs (2)
130public static IEnumerable<string> GetStringListPropertyValue(this ProjectInstance project, string propertyName) 136public static bool GetBooleanPropertyValue(this ProjectInstance project, string propertyName, bool defaultValue = false)
Microsoft.Build (169)
BackEnd\BuildManager\BuildManager.cs (6)
191private readonly Dictionary<ProjectInstance, string> _unnamedProjectInstanceToNames; 305_unnamedProjectInstanceToNames = new Dictionary<ProjectInstance, string>(); 904public ProjectInstance GetProjectInstanceForBuild(Project project) 1325ProjectInstance? projectInstance = submission.BuildRequestData.ProjectInstance; 1556var instances = ProjectInstance.LoadSolutionForBuild( 1601ProjectInstance newInstance = project.CreateProjectInstance();
BackEnd\BuildManager\BuildRequestData.cs (6)
21public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild) 32public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild, HostServices hostServices) 44public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild, HostServices? hostServices, BuildRequestDataFlags flags) 57public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild, HostServices? hostServices, BuildRequestDataFlags flags, IEnumerable<string>? propertiesToTransfer) 86public BuildRequestData(ProjectInstance projectInstance, string[] targetsToBuild, HostServices? hostServices, BuildRequestDataFlags flags, IEnumerable<string>? propertiesToTransfer, RequestedProjectState requestedProjectState) 166public ProjectInstance? ProjectInstance
BackEnd\Components\ProjectCache\ProjectCacheService.cs (1)
173private IEnumerable<ProjectCacheDescriptor> GetProjectCacheDescriptors(ProjectInstance projectInstance)
BackEnd\Components\RequestBuilder\IntrinsicTask.cs (3)
26protected IntrinsicTask(TargetLoggingContext loggingContext, ProjectInstance projectInstance, bool logTaskInputs) 45internal ProjectInstance Project 68internal static IntrinsicTask InstantiateTask(ProjectTargetInstanceChild taskInstance, TargetLoggingContext loggingContext, ProjectInstance projectInstance, bool logTaskInputs)
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupIntrinsicTask.cs (1)
42public ItemGroupIntrinsicTask(ProjectItemGroupTaskInstance taskInstance, TargetLoggingContext loggingContext, ProjectInstance projectInstance, bool logTaskInputs)
BackEnd\Components\RequestBuilder\IntrinsicTasks\PropertyGroupIntrinsicTask.cs (1)
37public PropertyGroupIntrinsicTask(ProjectPropertyGroupTaskInstance taskInstance, TargetLoggingContext loggingContext, ProjectInstance projectInstance, bool logTaskInputs)
BackEnd\Components\RequestBuilder\RequestBuilder.cs (2)
1475ProjectInstance project = _requestEntry?.RequestConfiguration?.Project; 1515ProjectInstance project = _requestEntry?.RequestConfiguration?.Project;
BackEnd\Components\RequestBuilder\TargetBuilder.cs (1)
86private ProjectInstance _projectInstance;
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (2)
56internal TargetUpToDateChecker(ProjectInstance project, ProjectTargetInstance targetToAnalyze, ILoggingService loggingServices, BuildEventContext buildEventContext) 1237private ProjectInstance _project;
BackEnd\Shared\BuildRequestConfiguration.cs (8)
88private ProjectInstance _project; 93private ProjectInstance _transferredState; 211internal BuildRequestConfiguration(int configId, ProjectInstance instance) 380public ProjectInstance Project 415private void SetProjectBasedState(ProjectInstance project) 509private void InitializeProject(BuildParameters buildParameters, Func<ProjectInstance> loadProjectFromFile) 938translator.Translate(ref _transferredState, ProjectInstance.FactoryForDeserialization); 979internal void ApplyTransferredState(ProjectInstance instance)
BackEnd\Shared\BuildResult.cs (11)
130/// <see cref="ProjectInstance"/> state after the build. This is only provided if <see cref="BuildRequest.BuildRequestDataFlags"/> 134/// be used to retrieve <see cref="ProjectInstance.Properties"/>, <see cref="ProjectInstance.GlobalProperties"/> and 135/// <see cref="ProjectInstance.Items"/> from it. No other operation is guaranteed to be supported. 137private ProjectInstance? _projectStateAfterBuild; 409/// <see cref="ProjectInstance"/> state after the build. In general, it may be a non buildable-dummy object, and should only 410/// be used to retrieve <see cref="ProjectInstance.Properties"/>, <see cref="ProjectInstance.GlobalProperties"/> and 411/// <see cref="ProjectInstance.Items"/> from it. Any other operation is not guaranteed to be supported. 413public ProjectInstance? ProjectStateAfterBuild 635translator.Translate(ref _projectStateAfterBuild, ProjectInstance.FactoryForDeserialization);
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (3)
87private ProjectInstance _projectInstance; 208public ProjectInstance ProjectInstance => _projectInstance; 250public void InitializeForTask(IBuildEngine2 buildEngine, TargetLoggingContext loggingContext, ProjectInstance projectInstance, string taskName, ElementLocation taskLocation, ITaskHost taskHost, bool continueOnError,
Construction\Solution\SolutionProjectGenerator.cs (35)
209internal static ProjectInstance[] Generate( 692private ProjectInstance[] Generate() 719private ProjectInstance[] CreateSolutionProject(string wrapperProjectToolsVersion, bool explicitToolsVersionSpecified) 747var projectInstances = new List<ProjectInstance>(projectsInOrder.Count + 1); 750ProjectInstance traversalInstance = CreateTraversalInstance(wrapperProjectToolsVersion, explicitToolsVersionSpecified, projectsInOrder); 779foreach (ProjectInstance instance in projectInstances) 790private void EvaluateAndAddProjects(List<ProjectInSolution> projectsInOrder, List<ProjectInstance> projectInstances, ProjectInstance traversalInstance, string selectedSolutionConfiguration) 825ProjectInstance metaproject = CreateMetaproject(traversalInstance, project, projectConfiguration); 840private void AddStandardTraversalTargets(ProjectInstance traversalInstance, List<ProjectInSolution> projectsInOrder) 855private ProjectInstance CreateTraversalInstance(string wrapperProjectToolsVersion, bool explicitToolsVersionSpecified, List<ProjectInSolution> projectsInOrder) 990var traversalInstance = new ProjectInstance( 1068private void AddProjectReference(ProjectInstance traversalProject, ProjectInstance projectInstance, ProjectInSolution projectToAdd, ProjectConfigurationInSolution projectConfiguration, bool direct) 1101private static string GetToolsVersionMetadataForDirectMSBuildTask(ProjectInstance traversalProject) 1118private static string GetPropertiesMetadataForProjectReference(ProjectInstance traversalProject, string configurationAndPlatformProperties) 1157private bool CanBuildDirectly(ProjectInstance traversalProject, ProjectInSolution projectToAdd, ProjectConfigurationInSolution projectConfiguration) 1224private ProjectInstance CreateMetaproject(ProjectInstance traversalProject, ProjectInSolution project, ProjectConfigurationInSolution projectConfiguration) 1227ProjectInstance metaprojectInstance = new ProjectInstance(EscapingUtilities.UnescapeAll(GetMetaprojectName(project)), traversalProject, GetMetaprojectGlobalProperties(traversalProject)); 1319private void AddMetaprojectReferenceItems(ProjectInstance traversalProject, ProjectInstance metaprojectInstance, ProjectInSolution project) 1347private static void AddMetaprojectTargetForManagedProject(ProjectInstance traversalProject, ProjectInstance metaprojectInstance, ProjectInSolution project, ProjectConfigurationInSolution projectConfiguration, string targetName, string outputItem) 1366private static void AddProjectBuildTask(ProjectInstance traversalProject, ProjectConfigurationInSolution projectConfiguration, ProjectTargetInstance target, string targetToBuild, string sourceItems, string condition, string outputItem) 1865private void AddMetaprojectTargetForUnknownProjectType(ProjectInstance traversalProject, ProjectInstance metaprojectInstance, ProjectInSolution project, string targetName, string unknownProjectTypeErrorMessage) 1935private void AddValidateProjectsTarget(ProjectInstance traversalProject, List<ProjectInSolution> projects) 1977private static void AddTraversalReferencesTarget(ProjectInstance traversalProject, string targetName, string outputItem, bool batchBuildTargets) 2029private void AddTraversalTargetForProject(ProjectInstance traversalProject, ProjectInSolution project, ProjectConfigurationInSolution projectConfiguration, string targetToBuild, string outputItem, bool canBuildDirectly) 2074private IDictionary<string, string> GetMetaprojectGlobalProperties(ProjectInstance traversalProject) 2347private void AddInitialTargets(ProjectInstance traversalProject, List<ProjectInSolution> projects) 2358private void AddValidateSolutionConfigurationTarget(ProjectInstance traversalProject) 2393private static void AddValidateToolsVersionsTarget(ProjectInstance traversalProject) 2406private static void AddGetSolutionConfigurationContentsTarget(ProjectInstance traversalProject)
Definition\Project.cs (6)
1367public ProjectInstance CreateProjectInstance() 1381public ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings) 1392public ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext) 3293public override ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext) 3361ProjectInstance instance = CreateProjectInstance(LoggingService, ProjectInstanceSettings.None, evaluationContext); 3720private ProjectInstance CreateProjectInstance(
Graph\GraphBuilder.cs (4)
53private ConcurrentDictionary<ConfigurationMetadata, Lazy<ProjectInstance>> _platformNegotiationInstancesCache = new(); 530var projectInstance = _projectInstanceFactory( 595private ProjectInstance GetInstanceForPlatformNegotiationWithCaching( 602new Lazy<ProjectInstance>(() => _projectInstanceFactory(projectPath, globalProperties, projectCollection))).Value;
Graph\ProjectGraph.cs (9)
33/// A callback used for constructing a <see cref="ProjectInstance" /> for a specific 39/// <returns>A <see cref="ProjectInstance" /> instance. This value must not be null.</returns> 55public delegate ProjectInstance ProjectInstanceFactoryFunc( 177/// A delegate used for constructing a <see cref="ProjectInstance" />, called for each 318/// A delegate used for constructing a <see cref="ProjectInstance" />, called for each 355/// A delegate used for constructing a <see cref="ProjectInstance" />, called for each 396/// A delegate used for constructing a <see cref="ProjectInstance" />, called for each 835internal ProjectInstance DefaultProjectInstanceFactory( 849internal static ProjectInstance StaticProjectInstanceFactory(
Graph\ProjectGraphNode.cs (2)
27internal ProjectGraphNode(ProjectInstance projectInstance) 48public ProjectInstance ProjectInstance { get; }
Graph\ProjectInterpretation.cs (9)
82ProjectInstance requesterInstance = projectGraphNode.ProjectInstance; 180var projectInstance = projectInstanceFactory( 211internal static string GetInnerBuildPropertyValue(ProjectInstance project) 216internal static string GetInnerBuildPropertyName(ProjectInstance project) 221internal static string GetInnerBuildPropertyValues(ProjectInstance project) 226internal static ProjectType GetProjectType(ProjectInstance project) 283private static IEnumerable<ProjectItemInstance> ConstructInnerBuildReferences(ProjectInstance outerBuild) 492public static TargetsToPropagate FromProjectAndEntryTargets(ProjectInstance project, ImmutableList<string> entryTargets) 554ProjectInstance projectInstance = projectGraphNode.ProjectInstance;
Instance\ProjectInstance.cs (28)
198/// of another ProjectInstance. <seealso cref="ProjectInstance(ProjectInstance, bool, RequestedProjectState)"/> 422/// The resulting <see cref="ProjectInstance"/> object wraps the <see cref="Project"/> 562internal ProjectInstance(string projectFile, ProjectInstance projectToInheritFrom, IDictionary<string, string> globalProperties) 625/// Initializes a new instance of the <see cref="ProjectInstance"/> class directly. 738private ProjectInstance(ProjectInstance that, bool isImmutable, RequestedProjectState filter = null) 918public static ProjectInstance FromFile(string file, ProjectOptions options) 937public static ProjectInstance FromProjectRootElement(ProjectRootElement rootElement, ProjectOptions options) 956public static ProjectInstance FromImmutableProjectSource(Project project, ProjectInstanceSettings settings) 980ProjectInstance owningProjectInstance) 1002ProjectInstance owningProjectInstance, 1309/// of another ProjectInstance. <seealso cref="ProjectInstance(ProjectInstance, bool, RequestedProjectState)"/> 2129public ProjectInstance DeepCopy() 2144public ProjectInstance FilteredCopy(RequestedProjectState filter) 2154public ProjectInstance DeepCopy(bool isImmutable) 2411/// from the <see cref="ProjectInstance"/> provided. 2413/// <param name="projectState"><see cref="ProjectInstance"/> with the state to use.</param> 2414public void UpdateStateFrom(ProjectInstance projectState) 2431ErrorUtilities.VerifyThrow(TaskRegistry != null, $"{nameof(TaskRegistry)} Cannot be null after {nameof(ProjectInstance)} object creation."); 2611internal static ProjectInstance[] LoadSolutionForBuild( 2629ProjectInstance[] projectInstances = null; 2675private static ProjectInstance[] CalculateToolsVersionAndGenerateSolutionWrapper( 2701ProjectInstance[] projectInstances = null; 2749internal static ProjectInstance FactoryForDeserialization(ITranslator translator) 2966private static ProjectInstance[] GenerateSolutionWrapper( 2992ProjectInstance[] instances = SolutionProjectGenerator.Generate(sp, globalProperties, toolsVersion, projectBuildEventContext, loggingService, targetNames, sdkResolverService, submissionId); 3019private static ProjectInstance[] GenerateSolutionWrapperUsingOldOM( 3093ProjectInstance instance = new(projectRootElement, globalProperties, toolsVersion, buildParameters, loggingService, projectBuildEventContext, sdkResolverService, submissionId); 3475ProjectInstance projectInstance,
Instance\ProjectItemInstance.cs (29)
49private ProjectInstance _project; 70internal ProjectItemInstance(ProjectInstance project, string itemType, string includeEscaped, string definingFileEscaped) 82internal ProjectItemInstance(ProjectInstance project, string itemType, string includeEscaped, string includeBeforeWildcardExpansionEscaped, string definingFileEscaped) 101ProjectInstance project, 124internal ProjectItemInstance(ProjectInstance project, string itemType, string includeEscaped, IEnumerable<KeyValuePair<string, string>> directMetadata, string definingFileEscaped) 148private ProjectItemInstance(ProjectItemInstance that, ProjectInstance newProject) 158private ProjectItemInstance(ProjectInstance projectInstance) 169public ProjectInstance Project 636internal static ProjectItemInstance FactoryForDeserialization(ITranslator translator, ProjectInstance projectInstance) 694internal ProjectItemInstance DeepClone(ProjectInstance newProject) 726ProjectInstance projectToUse, 930ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 956ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1050ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1153ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1438ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1449ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1460ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1506ProjectInstance.VerifyThrowNotImmutable(destinationAsTaskItem._isImmutable); 1821ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1939ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1956ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1977ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 1996ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 2007ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 2022ProjectInstance.VerifyThrowNotImmutable(_isImmutable); 2191private ProjectInstance _project; 2198internal ProjectItemInstanceFactory(ProjectInstance project) 2206internal ProjectItemInstanceFactory(ProjectInstance project, string itemType)
Instance\ProjectPropertyInstance.cs (1)
76ProjectInstance.VerifyThrowNotImmutable(IsImmutable);
ObjectModelRemoting\DefinitionObjectsLinks\ProjectLink.cs (1)
236public abstract ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext);
Microsoft.Build.Engine.OM.UnitTests (91)
Definition\DefinitionEditing_Tests.cs (1)
1829ProjectInstance instance = project.CreateProjectInstance();
Definition\Project_Tests.cs (7)
681ProjectInstance projectInstance = new ProjectInstance(xml); 719ProjectInstance projectInstance = new ProjectInstance(xml); 755ProjectInstance projectInstance = new ProjectInstance(xml); 793ProjectInstance projectInstance = new ProjectInstance(xml); 1765ProjectInstance projectInstance = project.CreateProjectInstance(); 3867var projectInstance = project.CreateProjectInstance(); 3879var newProjectInstance = project.CreateProjectInstance();
Definition\ProjectItem_Tests.cs (3)
952Should.Throw<InvalidProjectFileException>(() => { ProjectInstance.FromFile(testProjectFile, new ProjectOptions()); }); 963ProjectInstance.FromFile(testProjectFile, options); 3756var projectInstance = buildManager.GetProjectInstanceForBuild(project);
Definition\ProjectItemDefinition_Tests.cs (1)
453ProjectInstance instance = project.CreateProjectInstance();
Instance\ProjectInstance_Tests.cs (63)
40ProjectInstance i = p.CreateProjectInstance(); 51ProjectInstance p = GetSampleProjectInstance(); 63ProjectInstance p = GetSampleProjectInstance(); 83ProjectInstance p = GetEmptyProjectInstance(); 104ProjectInstance p = GetEmptyProjectInstance(); 125ProjectInstance p = GetEmptyProjectInstance(); 156ProjectInstance p = GetEmptyProjectInstance(); 168ProjectInstance p = GetEmptyProjectInstance(); 180ProjectInstance p = GetEmptyProjectInstance(); 190ProjectInstance p = GetEmptyProjectInstance(); 204ProjectInstance instance = p.CreateProjectInstance(); 222ProjectInstance first = GetSampleProjectInstance(); 223ProjectInstance second = first.DeepCopy(); 234ProjectInstance first = GetSampleProjectInstance(); 235ProjectInstance second = first.DeepCopy(); 262ProjectInstance project = GetProjectInstance(content); 305ProjectInstance projectInstance = GetProjectInstance(content); 327ProjectInstance first = GetSampleProjectInstance(); 328ProjectInstance second = first.DeepCopy(); 345ProjectInstance instance = new ProjectInstance(ProjectRootElement.Create()); 357ProjectInstance instance = new ProjectInstance(ProjectRootElement.Create()); 369ProjectInstance instance = new ProjectInstance(ProjectRootElement.Create()); 382ProjectInstance instance = new ProjectInstance(xml); 397ProjectInstance instance1 = new Project().CreateProjectInstance(); 427var projBInstance = projBEval.CreateProjectInstance(); 469var projBInstance = new ProjectInstance(projBEval, ProjectInstanceSettings.ImmutableWithFastItemLookup); 511var projBInstance = projBEval.CreateProjectInstance(); 668var instance = GetSampleProjectInstance(true /* immutable */); 679var instance = GetSampleProjectInstance(true /* immutable */); 690var instance = GetSampleProjectInstance(true /* immutable */); 701var instance = GetSampleProjectInstance(true /* immutable */); 712var instance = GetSampleProjectInstance(true /* immutable */); 723var instance = GetSampleProjectInstance(true /* immutable */); 734var instance = GetSampleProjectInstance(true /* immutable */); 745var instance = GetSampleProjectInstance(true /* immutable */); 756var instance = GetSampleProjectInstance(true /* immutable */); 767var instance = GetSampleProjectInstance(true /* immutable */); 778var instance = GetSampleProjectInstance(true /* immutable */); 789var instance = GetSampleProjectInstance(true /* immutable */); 800var instance = GetSampleProjectInstance(true /* immutable */); 811var instance = GetSampleProjectInstance(true /* immutable */); 822var instance = GetSampleProjectInstance(true /* immutable */); 833var instance = GetSampleProjectInstance(true /* immutable */); 845var instance = GetSampleProjectInstance(true /* immutable */); 857var instance = GetSampleProjectInstance(true /* immutable */); 868var protoInstance = GetSampleProjectInstance(true /* immutable */); 869var instance = protoInstance.DeepCopy(false /* mutable */); 887var protoInstance = GetSampleProjectInstance(false /* mutable */); 888var instance = protoInstance.DeepCopy(true /* immutable */); 909var protoInstance = GetSampleProjectInstance(true /* immutable */); 910var instance = protoInstance.DeepCopy(/* inherit */); 934var protoInstance = GetSampleProjectInstance(true /* immutable */); 935var instance = protoInstance.DeepCopy(true /* immutable */); 956var protoInstance = GetSampleProjectInstance(false /* mutable */); 957var instance = protoInstance.DeepCopy(/* inherit */); 973var protoInstance = GetSampleProjectInstance(false /* mutable */); 974var instance = protoInstance.DeepCopy(false /* mutable */); 987private static ProjectInstance GetSampleProjectInstance(bool isImmutable = false) 1016ProjectInstance p = GetProjectInstance(content, isImmutable); 1024private static ProjectInstance GetProjectInstance(string content, bool immutable = false) 1031ProjectInstance instance = immutable ? project.CreateProjectInstance(ProjectInstanceSettings.Immutable) : project.CreateProjectInstance(); 1039private static ProjectInstance GetEmptyProjectInstance() 1043ProjectInstance instance = project.CreateProjectInstance();
Instance\ProjectItemInstance_Tests.cs (4)
246ProjectInstance projectInstance = project.CreateProjectInstance(); 341ProjectInstance projectInstance = project.CreateProjectInstance(); 1166ProjectInstance project = new ProjectInstance(xml); 1188ProjectInstance projectInstance = project.CreateProjectInstance();
Instance\ProjectMetadataInstance_Tests.cs (1)
35ProjectInstance projectInstance = project.CreateProjectInstance();
Instance\ProjectOnErrorInstance_Tests.cs (1)
46ProjectInstance instance = project.CreateProjectInstance();
Instance\ProjectPropertyInstance_Tests.cs (2)
93var snapshot = project.CreateProjectInstance(ProjectInstanceSettings.Immutable); 104ProjectInstance projectInstance = project.CreateProjectInstance();
Instance\ProjectTargetInstance_Tests.cs (4)
56ProjectInstance instance = project.CreateProjectInstance(); 76ProjectInstance instance = project.CreateProjectInstance(); 96ProjectInstance instance = project.CreateProjectInstance(); 147ProjectInstance instance = project.CreateProjectInstance();
Instance\ProjectTaskInstance_Tests.cs (1)
76ProjectInstance instance = project.CreateProjectInstance();
Instance\ProjectTaskOutputItemInstance_Tests.cs (1)
49ProjectInstance instance = project.CreateProjectInstance();
Instance\ProjectTaskOutputPropertyInstance_Tests.cs (1)
49ProjectInstance instance = project.CreateProjectInstance();
ObjectModelRemoting\RemoteProjectsProviderMock\EvaluationLinkMocks\MockProjectLink.cs (1)
185public override ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext) => throw new NotImplementedException();
Microsoft.Build.Engine.UnitTests (335)
BackEnd\BatchingEngine_Tests.cs (4)
28ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 126ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 163ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 225ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance();
BackEnd\BuildManager_Tests.cs (29)
354ProjectInstance rootProject = GenerateDummyProjects(shutdownProjectDirectory, numberOfParallelProjectsToBuild, projectCollection); 1775ProjectInstance instance = _buildManager.GetProjectInstanceForBuild(project); 1806ProjectInstance instance = _buildManager.GetProjectInstanceForBuild(project); 1841ProjectInstance instance = _buildManager.GetProjectInstanceForBuild(project); 1898ProjectInstance instance = _buildManager.GetProjectInstanceForBuild(project); 1899ProjectInstance instance2 = _buildManager.GetProjectInstanceForBuild(project); 1926ProjectInstance instance = _buildManager.GetProjectInstanceForBuild(project); 1952ProjectInstance instance = _buildManager.GetProjectInstanceForBuild(project); 1984ProjectInstance instance = _buildManager.GetProjectInstanceForBuild(project); 1997ProjectInstance instance2 = _buildManager.GetProjectInstanceForBuild(project); 2034ProjectInstance projectInstance = CreateProjectInstance(contents1, null, _projectCollection, false); 2061ProjectInstance projectInstance2 = CreateProjectInstance(contents1, null, _projectCollection, false); 2265ProjectInstance instance = project.CreateProjectInstance(); 2316ProjectInstance instance = project.CreateProjectInstance(); 3139ProjectInstance pi = BuildManager.DefaultBuildManager.GetProjectInstanceForBuild(project1); 3150ProjectInstance pi = BuildManager.DefaultBuildManager.GetProjectInstanceForBuild(project2); 3218ProjectInstance pi = BuildManager.DefaultBuildManager.GetProjectInstanceForBuild(project2); 3230ProjectInstance pi = BuildManager.DefaultBuildManager.GetProjectInstanceForBuild(project1); 3305ProjectInstance pi = BuildManager.DefaultBuildManager.GetProjectInstanceForBuild(project2); 3317ProjectInstance pi = BuildManager.DefaultBuildManager.GetProjectInstanceForBuild(project1); 3408ProjectInstance instance = _buildManager.GetProjectInstanceForBuild(project); 3438ProjectInstance instance = _buildManager.GetProjectInstanceForBuild(project); 3469ProjectInstance instance = _buildManager.GetProjectInstanceForBuild(project); 3575private ProjectInstance CreateProjectInstance(string contents, string toolsVersion, ProjectCollection projectCollection, bool deleteTempProject) 3617private static ProjectInstance GenerateDummyProjects(string shutdownProjectDirectory, int parallelProjectCount, ProjectCollection projectCollection) 3706var mainInstance = mainProject.CreateProjectInstance(ProjectInstanceSettings.Immutable).DeepCopy(isImmutable: false); 3733var p2pInstance = p2pProject.CreateProjectInstance(ProjectInstanceSettings.Immutable).DeepCopy(isImmutable: false); 3858ProjectInstance instance = project.CreateProjectInstance(ProjectInstanceSettings.Immutable).DeepCopy(false); 4412ProjectInstance instance = _buildManager.GetProjectInstanceForBuild(project);
BackEnd\BuildRequestConfiguration_Tests.cs (5)
188ProjectInstance projectInstance = project.CreateProjectInstance(); 286ProjectInstance instance = project.CreateProjectInstance(); 363ProjectInstance instance = project.CreateProjectInstance(); 465ProjectInstance instance = project.CreateProjectInstance(); 568var projectInstance = project.CreateProjectInstance();
BackEnd\BuildRequestEngine_Tests.cs (1)
234private ProjectInstance CreateStandinProject()
BackEnd\IntrinsicTask_Tests.cs (17)
1278ProjectInstance p = project.CreateProjectInstance(); 1311ProjectInstance p = project.CreateProjectInstance(); 2298ProjectInstance p = project.CreateProjectInstance(); 2332ProjectInstance p = project.CreateProjectInstance(); 2369ProjectInstance p = project.CreateProjectInstance(); 2406ProjectInstance p = project.CreateProjectInstance(); 2443ProjectInstance p = project.CreateProjectInstance(); 2481ProjectInstance p = project.CreateProjectInstance(); 2512ProjectInstance p = project.CreateProjectInstance(); 3199ProjectInstance p = project.CreateProjectInstance(); 3245ProjectInstance p = project.CreateProjectInstance(); 3541ProjectInstance instance = new ProjectInstance(xml); 3908private static Lookup GenerateLookupWithItemsAndProperties(ProjectInstance project) 3917private static Lookup GenerateLookup(ProjectInstance project) 3922private static Lookup GenerateLookup(ProjectInstance project, PropertyDictionary<ProjectPropertyInstance> properties) 3953ProjectInstance projectInstance = project.CreateProjectInstance(); 3988var projectInstance = project.CreateProjectInstance();
BackEnd\Lookup_Tests.cs (24)
26ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 48ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 80ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 150ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 200ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 251ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 302ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 357ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 399ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 463ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 523ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 594ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 661ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 716ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 764ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 820ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 861ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 896ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 967ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 1013ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 1024ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 1075ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 1128ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 1165ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance();
BackEnd\MSBuild_Tests.cs (8)
142ProjectInstance pi = p.CreateProjectInstance(); 555ProjectInstance pi = p.CreateProjectInstance(); 624ProjectInstance pi = p.CreateProjectInstance(); 931ProjectInstance pi = p.CreateProjectInstance(); 1051ProjectInstance pi = p.CreateProjectInstance(); 1120ProjectInstance pi = p.CreateProjectInstance(); 1187ProjectInstance pi = p.CreateProjectInstance(); 1802ProjectInstance pi = p.CreateProjectInstance();
BackEnd\SdkResultOutOfProc_Tests.cs (3)
110ProjectInstance projectInstance = CreateProjectInstance(projectPath, MSBuildDefaultToolsVersion, _projectCollection); 155ProjectInstance projectInstance = CreateProjectInstance(entryProjectPath, MSBuildDefaultToolsVersion, _projectCollection); 198private ProjectInstance CreateProjectInstance(string projectPath, string toolsVersion, ProjectCollection projectCollection)
BackEnd\TargetBuilder_Tests.cs (36)
98ProjectInstance project = CreateTestProject(); 118ProjectInstance project = CreateTestProject(); 145ProjectInstance project = CreateTestProject(); 168ProjectInstance project = CreateTestProject(); 360ProjectInstance project = CreateTestProject(projectBody); 500ProjectInstance project = CreateTestProject(projectBody); 526ProjectInstance project = CreateTestProject(projectBody); 552ProjectInstance project = CreateTestProject(projectBody); 582ProjectInstance project = CreateTestProject(projectBody); 617ProjectInstance project = CreateTestProject(projectBody); 649ProjectInstance project = CreateTestProject(projectBody); 680ProjectInstance project = CreateTestProject(projectBody); 706ProjectInstance project = CreateTestProject(projectBody); 742ProjectInstance project = CreateTestProject(projectBody); 768ProjectInstance project = CreateTestProject(projectBody); 795ProjectInstance project = CreateTestProject(projectBody); 825ProjectInstance project = CreateTestProject(projectBody); 869ProjectInstance project = CreateTestProject(projectBody); 896ProjectInstance project = CreateTestProject(projectBody); 923ProjectInstance project = CreateTestProject(projectBody); 955ProjectInstance project = CreateTestProject(projectBody); 1053ProjectInstance project = CreateTestProject(projectBody); 1088ProjectInstance project = CreateTestProject(projectBody); 1139ProjectInstance project = CreateTestProject(projectBody); 1199ProjectInstance project = CreateTestProject(projectBody); 1241ProjectInstance project = CreateTestProject(projectBody); 1287ProjectInstance project = CreateTestProject(projectBody); 1318ProjectInstance project = CreateTestProject(projectBody); 1392ProjectInstance project = CreateTestProject(projectBody); 1422var project = CreateTestProject(projectContents, string.Empty, "Build"); 1450var project = CreateTestProject(projectContents, string.Empty, "Build"); 1569private Lookup CreateStandardLookup(ProjectInstance project) 1579private ProjectInstance CreateTestProject() 1647private ProjectInstance CreateTestProject(string projectBodyContents) 1655private ProjectInstance CreateTestProject(string projectBodyContents, string initialTargets, string defaultTargets) 1704ProjectInstance project = CreateTestProject(projectBody);
BackEnd\TargetEntry_Tests.cs (23)
85ProjectInstance project = CreateTestProject(true /* Returns enabled */); 100ProjectInstance project = CreateTestProject(true /* Returns enabled */); 114ProjectInstance project = CreateTestProject(true /* Returns enabled */); 128ProjectInstance project = CreateTestProject(true /* Returns enabled */); 141ProjectInstance project = CreateTestProject(true /* Returns enabled */); 155ProjectInstance project = CreateTestProject(true /* Returns enabled */); 169ProjectInstance project = CreateTestProject(returnsEnabledForThisProject); 206ProjectInstance project = CreateTestProject(returnsEnabledForThisProject); 248ProjectInstance project = CreateTestProject(returnsEnabledForThisProject); 313ProjectInstance project = CreateTestProject(returnsEnabledForThisProject); 342ProjectInstance project = CreateTestProject(returnsEnabledForThisProject); 448ProjectInstance project = CreateTestProject(returnsEnabledForThisProject); 474ProjectInstance project = CreateTestProject(true /* returns are enabled */); 492ProjectInstance project = CreateTestProject(true /* returns are enabled */); 511ProjectInstance project = CreateTestProject(returnsEnabledForThisProject); 529ProjectInstance project = CreateTestProject(returnsEnabledForThisProject); 547ProjectInstance project = CreateTestProject(returnsEnabledForThisProject); 565ProjectInstance project = CreateTestProject(returnsEnabledForThisProject); 583ProjectInstance project = CreateTestProject(returnsEnabledForThisProject); 892private void ExecuteEntry(ProjectInstance project, TargetEntry entry) 915private TargetEntry CreateStandardTargetEntry(ProjectInstance project, string targetName) 933private TargetEntry CreateStandardTargetEntry(ProjectInstance project, string target, TargetEntry baseEntry) 946private ProjectInstance CreateTestProject(bool returnsAttributeEnabled)
BackEnd\TargetUpToDateChecker_Tests.cs (4)
169ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 206ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 250ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 609ProjectInstance p = project.CreateProjectInstance();
BackEnd\TaskExecutionHost_Tests.cs (4)
986ProjectInstance project = CreateTestProject(); 1014ProjectInstance project = CreateTestProject(); 1244ProjectInstance project = CreateTestProject(); 1495private ProjectInstance CreateTestProject()
BackEnd\TaskHostFactory_Tests.cs (3)
68ProjectInstance projectInstance = new(project.Path); 140ProjectInstance projectInstance = new(project.Path); 293ProjectInstance projectInstance = new(project.ProjectFile);
BackEnd\TaskRegistry_Tests.cs (1)
2203ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance();
Collections\OMcollections_tests.cs (2)
311ProjectInstance projectInstance = project.CreateProjectInstance(); 323ProjectInstance projectInstance = project.CreateProjectInstance();
Construction\SolutionFilter_Tests.cs (1)
143ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, null, _buildEventContext, mockLogger);
Construction\SolutionProjectGenerator_Tests.cs (42)
78ProjectInstance[] instances = SolutionProjectGenerator.Generate(SolutionFile.Parse(sln.Path), null, null, _buildEventContext, CreateMockLoggingService()); 108ProjectInstance[] instances = SolutionProjectGenerator.Generate(SolutionFile.Parse(solutionPath), null, null, _buildEventContext, CreateMockLoggingService()); 404ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, "3.5", _buildEventContext, CreateMockLoggingService()); 445ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, "3.5", _buildEventContext, CreateMockLoggingService()); 475ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, null, _buildEventContext, CreateMockLoggingService()); 522ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, null, _buildEventContext, CreateMockLoggingService()); 563ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, null, _buildEventContext, CreateMockLoggingService()); 676ProjectInstance[] instances = SolutionProjectGenerator.Generate(sp, null, null, _buildEventContext, CreateMockLoggingService()); 698ProjectInstance[] instances1 = SolutionProjectGenerator.Generate(sp1, null, null, _buildEventContext, CreateMockLoggingService()); 762ProjectInstance[] instances = SolutionProjectGenerator.Generate(sp, null, null, _buildEventContext, CreateMockLoggingService()); 824ProjectInstance[] instances = SolutionProjectGenerator.Generate(sp, null, null, _buildEventContext, CreateMockLoggingService()); 1098var projectBravoMetaProject = instances[1]; 1322var instance = SolutionProjectGenerator.Generate(solution, null, ObjectModelHelpers.MSBuildDefaultToolsVersion, _buildEventContext, CreateMockLoggingService())[0]; 1394ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, ObjectModelHelpers.MSBuildDefaultToolsVersion, _buildEventContext, CreateMockLoggingService()); 1397foreach (ProjectInstance instance in instances) 1543ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, "invalid", _buildEventContext, CreateMockLoggingService()); 1589ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, null, BuildEventContext.Invalid, CreateMockLoggingService()); 1670ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, null, BuildEventContext.Invalid, CreateMockLoggingService()); 1702ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, null, BuildEventContext.Invalid, CreateMockLoggingService()); 1729ProjectInstance msbuildProject = CreateVenusSolutionProject(globalProperties, useNewParser); 1760ProjectInstance msbuildProject = CreateVenusSolutionProject(useNewParser); 1799ProjectInstance msbuildProject = CreateVenusSolutionProject("2.0", useNewParser); 1827ProjectInstance msbuildProject = CreateVenusSolutionProject(useNewParser); 1855ProjectInstance msbuildProject = CreateVenusSolutionProject(useNewParser); 1966ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, null, BuildEventContext.Invalid, CreateMockLoggingService()); 2027ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, null, BuildEventContext.Invalid, CreateMockLoggingService()); 2112ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, globalProperties, null, BuildEventContext.Invalid, CreateMockLoggingService()); 2113ProjectInstance msbuildProject = instances[0]; 2384ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, globalProperties, null, BuildEventContext.Invalid, collection.LoggingService); 2434ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, null, BuildEventContext.Invalid, CreateMockLoggingService(), new List<string> { "One" }); 2493ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, null, null, BuildEventContext.Invalid, CreateMockLoggingService(), null); 2546ProjectInstance[] instances; 2633ProjectInstance projectInstance = SolutionProjectGenerator.Generate(solutionFile, null, null, BuildEventContext.Invalid, CreateMockLoggingService(), new[] { "MyTarget" }).FirstOrDefault(); 2694ProjectInstance projectInstance = SolutionProjectGenerator.Generate(solutionFile, null, null, BuildEventContext.Invalid, CreateMockLoggingService(), targetsToBuild).FirstOrDefault(); 2811ProjectInstance projectInstance = SolutionProjectGenerator.Generate(solutionFile, globalProperties, null, BuildEventContext.Invalid, CreateMockLoggingService(), new[] { "Build" }).FirstOrDefault(); 2855private ProjectInstance CreateVenusSolutionProject(bool useNewParser) 2863private ProjectInstance CreateVenusSolutionProject(IDictionary<string, string> globalProperties, bool useNewParser) 2871private ProjectInstance CreateVenusSolutionProject(string toolsVersion, bool useNewParser) 2882private ProjectInstance CreateVenusSolutionProject(IDictionary<string, string> globalProperties, string toolsVersion, bool useNewParser) 2924ProjectInstance[] instances = SolutionProjectGenerator.Generate(solution, globalProperties, toolsVersion, BuildEventContext.Invalid, CreateMockLoggingService()); 2943private void AssertProjectContainsItem(ProjectInstance msbuildProject, string itemType, string include) 2963private void AssertProjectItemNameCount(ProjectInstance msbuildProject, string itemType, int count)
Definition\ItemDefinitionGroup_Tests.cs (3)
596ProjectInstance pi = p.CreateProjectInstance(); 632ProjectInstance pi = p.CreateProjectInstance(); 674ProjectInstance pi = p.CreateProjectInstance();
Definition\ProjectEvaluationContext_Tests.cs (3)
152var projectInstance = ProjectInstance.FromFile( 248ProjectInstance.FromProjectRootElement(
Definition\ProjectHelpers.cs (2)
20internal static ProjectInstance CreateEmptyProjectInstance() 26ProjectInstance instance = project.CreateProjectInstance();
Definition\ToolsVersion_Tests.cs (4)
635ProjectInstance pi = projectFromString.Project.CreateProjectInstance(); 706ProjectInstance pi = projectFromString.Project.CreateProjectInstance(); 791ProjectInstance pi = new ProjectInstance(projectFromString.Project.Xml, null /* no global properties */, null /* don't explicitly set the toolsversion */, p); 901ProjectInstance pi = new ProjectInstance(projectFromString.Project.Xml, null /* no global properties */, null /* don't explicitly set the toolsversion */, p);
EscapingInProjects_Tests.cs (1)
651ProjectInstance projectInstance = project.CreateProjectInstance();
Evaluation\Evaluator_Tests.cs (5)
484ProjectInstance project = new ProjectInstance(subdirProjPath); 1462ProjectInstance instance = project.CreateProjectInstance(); 2349ProjectInstance instance = project.CreateProjectInstance(); 2374ProjectInstance instance = project.CreateProjectInstance(); 2398ProjectInstance instance = project.CreateProjectInstance();
Evaluation\Expander_Tests.cs (23)
82ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 139ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 174ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 194ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 214ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 235ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 252ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 278ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 651ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 689ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 709ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 729ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 747ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 796ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 1357ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 1570ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 3909ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance(); 4823ProjectInstance projectInstance = new ProjectInstance(projectFile.Path); 4867ProjectInstance projectInstance = new ProjectInstance(projectFile.Path); 4896ProjectInstance projectInstance = new ProjectInstance(projectFile.Path); 4943ProjectInstance projectInstance = new ProjectInstance(projectFile.Path); 4984ProjectInstance projectInstance = new ProjectInstance(projectFile.Path); 5018ProjectInstance projectInstance = new ProjectInstance(projectFile.Path);
Evaluation\ItemSpec_Tests.cs (1)
103var dummyProject = ProjectHelpers.CreateEmptyProjectInstance();
Evaluation\SdkResultEvaluation_Tests.cs (1)
538var instance = project.CreateProjectInstance();
EvaluationProfiler_Tests.cs (1)
281var projectInstance = _buildManager.GetProjectInstanceForBuild(project);
ExpressionTree_Tests.cs (6)
183ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create()); 213ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create()); 248ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create()); 280ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create()); 297ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create()); 326ProjectInstance parentProject = new ProjectInstance(ProjectRootElement.Create());
ExpressionTreeExpression_Tests.cs (1)
374ProjectInstance parentProject = new ProjectInstance(xml);
Graph\ProjectGraph_Tests.cs (2)
134var projectInstance = new Project().CreateProjectInstance(); 181var projectInstance = new Project().CreateProjectInstance();
Instance\HostServices_Tests.cs (3)
390ProjectInstance project = CreateDummyProject("foo.proj"); 474public ProjectInstance CreateDummyProject(string fileName) 485ProjectInstance instance = project.CreateProjectInstance();
Instance\ProjectInstance_Internal_Tests.cs (57)
70ProjectInstance project = new Project(projectRootElementFromString.Project).CreateProjectInstance(); 118ProjectInstance project = new Project(projectRootElementFromString.Project).CreateProjectInstance(); 144ProjectInstance project = projectFromString.Project.CreateProjectInstance(); 172ProjectInstance p = GetProjectInstance(content); 210ProjectInstance p = GetProjectInstance(content); 256ProjectInstance p = GetSampleProjectInstance(); 267ProjectInstance p = GetSampleProjectInstance(); 279ProjectInstance p = GetSampleProjectInstance(); 288var projectInstance = new ProjectInstance( 302ProjectInstance first = GetSampleProjectInstance(null, null, projectCollection, toolsVersion: "TESTTV"); 303ProjectInstance second = first.DeepCopy(); 322ProjectInstance p = GetSampleProjectInstance(null, null, collection); 356ProjectInstance p = GetSampleProjectInstance(null, null, collection); 384ProjectInstance p = GetSampleProjectInstance(null, globalProperties, collection); 425ProjectInstance p = new ProjectInstance(xml, globalProperties, ObjectModelHelpers.MSBuildDefaultToolsVersion, "ABCDEF", collection); 443ProjectInstance p = GetSampleProjectInstance(); 454ProjectInstance p = GetSampleProjectInstance(); 467ProjectInstance first = GetSampleProjectInstance(hostServices); 468ProjectInstance second = first.DeepCopy(); 487ProjectInstance first = GetSampleProjectInstance(); 488ProjectInstance second = first.DeepCopy(); 500ProjectInstance first = GetSampleProjectInstance(); 501ProjectInstance second = first.DeepCopy(); 513ProjectInstance first = GetSampleProjectInstance(); 514ProjectInstance second = first.DeepCopy(); 525ProjectInstance first = GetSampleProjectInstance(); 526ProjectInstance second = first.DeepCopy(); 537ProjectInstance first = GetSampleProjectInstance(); 538ProjectInstance second = first.DeepCopy(); 549ProjectInstance first = GetSampleProjectInstance(); 552ProjectInstance second = first.DeepCopy(); 580ProjectInstance projectInstance = GetProjectInstance(projectFileContent); 691var original = new ProjectInstance(rootElement); 696var copy = ProjectInstance.FactoryForDeserialization(TranslationHelpers.GetReadTranslator()); 701public delegate ProjectInstance ProjectInstanceFactory(string file, ProjectRootElement xml, ProjectCollection collection); 714(f, xml, c) => ProjectInstance.FromFile(f, new ProjectOptions { ProjectCollection = c }) 738(f, xml, c) => ProjectInstance.FromProjectRootElement(xml, new ProjectOptions { ProjectCollection = c }) 746var pi = new ProjectInstance(f, null, null, c); 751var copy = ProjectInstance.FactoryForDeserialization(TranslationHelpers.GetReadTranslator()); 770var projectInstance = projectInstanceFactory.Invoke(file, xml, projectCollection); 784ProjectInstance projectInstance = new ProjectInstance(rootElement); 820ProjectInstance projectInstance = new ProjectInstance(rootElement); 864ProjectInstance projectInstance = useDirectConstruction 898ProjectInstance projectInstance = ProjectInstance.FromFile( 926ProjectInstance projectInstance = ProjectInstance.FromProjectRootElement( 941private static ProjectInstance GetProjectInstance(string content) 949private static ProjectInstance GetProjectInstance(string content, HostServices hostServices) 957private static ProjectInstance GetProjectInstance(string content, HostServices hostServices, IDictionary<string, string> globalProperties, ProjectCollection projectCollection, string toolsVersion = null) 970ProjectInstance instance = project.CreateProjectInstance(); 978private static ProjectInstance GetSampleProjectInstance() 986private static ProjectInstance GetSampleProjectInstance(HostServices hostServices) 994private static ProjectInstance GetSampleProjectInstance(HostServices hostServices, IDictionary<string, string> globalProperties, ProjectCollection projectCollection, string toolsVersion = null) 1019ProjectInstance p = GetProjectInstance(content, hostServices, globalProperties, projectCollection, toolsVersion);
Instance\ProjectMetadataInstance_Internal_Tests.cs (1)
57ProjectInstance projectInstance = project.CreateProjectInstance();
Instance\ProjectPropertyInstance_Internal_Tests.cs (1)
95ProjectInstance projectInstance = project.CreateProjectInstance();
InstanceFromRemote\FakeProjectLink.cs (1)
87public override ProjectInstance CreateProjectInstance(ProjectInstanceSettings settings, EvaluationContext evaluationContext) => throw new NotImplementedException();
InstanceFromRemote\ProjectInstance_FromImmutableProjectLink_Tests.cs (8)
26ProjectInstance instance = ProjectInstance.FromImmutableProjectSource(project, ProjectInstanceSettings.ImmutableWithFastItemLookup); 44ProjectInstance instance = ProjectInstance.FromImmutableProjectSource(project, ProjectInstanceSettings.ImmutableWithFastItemLookup); 65ProjectInstance instance = ProjectInstance.FromImmutableProjectSource(project, ProjectInstanceSettings.ImmutableWithFastItemLookup); 100ProjectInstance instance = ProjectInstance.FromImmutableProjectSource(project, ProjectInstanceSettings.ImmutableWithFastItemLookup);
TestComparers\ProjectInstanceModelTestComparers.cs (4)
22public class ProjectInstanceComparer : IEqualityComparer<ProjectInstance> 24public bool Equals(ProjectInstance x, ProjectInstance y) 74public int GetHashCode(ProjectInstance obj)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (29)
TargetTests.cs (29)
34var instance = CreateProjectInstance(xmlReader); 58var instance = CreateProjectInstance(xmlReader); 82var instance = CreateProjectInstance(xmlReader); 107var instance = CreateProjectInstance(xmlReader); 134var instance = CreateProjectInstance(xmlReader); 160var instance = CreateProjectInstance(xmlReader); 193var instance = CreateProjectInstance(xmlReader); 222var instance = CreateProjectInstance(xmlReader); 254var instance = CreateProjectInstance(xmlReader); 296var instance = CreateProjectInstance(xmlReader); 336var instance = CreateProjectInstance(xmlReader); 371var instance = CreateProjectInstance(xmlReader); 429var instance = CreateProjectInstance(xmlReader); 458var instance = CreateProjectInstance(xmlReader); 482var instance = CreateProjectInstance(xmlReader); 509var instance = CreateProjectInstance(xmlReader); 534var instance = CreateProjectInstance(xmlReader); 558var instance = CreateProjectInstance(xmlReader); 584var instance = CreateProjectInstance(xmlReader); 605var instance = CreateProjectInstance(xmlReader); 630var instance = CreateProjectInstance(xmlReader); 656var instance = CreateProjectInstance(xmlReader); 695var instance = CreateProjectInstance(xmlReader); 752var instance = CreateProjectInstance(xmlReader); 813var instance = CreateProjectInstance(xmlReader); 875var instance = CreateProjectInstance(xmlReader); 893var instance = CreateProjectInstance(xmlReader); 910var instance = CreateProjectInstance(xmlReader); 925private static ProjectInstance CreateProjectInstance(XmlReader reader)
Microsoft.Build.Tasks.UnitTests (9)
AssignLinkMetadata_Tests.cs (1)
181ProjectInstance pi = p.CreateProjectInstance();
CallTarget_Tests.cs (1)
176ProjectInstance instance = project.CreateProjectInstance();
Exec_Tests.cs (2)
970var project = collection.LoadProject(testProject.ProjectFile).CreateProjectInstance(); 1027var project = collection.LoadProject(testProject.ProjectFile).CreateProjectInstance();
ResolveSDKReference_Tests.cs (5)
3811ProjectInstance project = pc.LoadProject(testProjectFile).CreateProjectInstance(); 3954ProjectInstance project = pc.LoadProject(testProjectFile).CreateProjectInstance(); 4063ProjectInstance project = pc.LoadProject(testProjectFile).CreateProjectInstance(); 4160ProjectInstance project = pc.LoadProject(testProjectFile).CreateProjectInstance(); 4329ProjectInstance project = pc.LoadProject(testProjectFile).CreateProjectInstance();
Microsoft.Build.UnitTests.Shared (3)
MockEngine.cs (1)
326ProjectInstance instance = _projectCollection.LoadProject(projectFileNames[i], finalGlobalProperties, null).CreateProjectInstance();
ObjectModelHelpers.cs (2)
1495var p = ProjectInstance.FromFile(testProjectFile, new ProjectOptions());
Microsoft.Build.Utilities.UnitTests (7)
MuxLogger_Tests.cs (7)
52ProjectInstance project = (projectFromString.Project).CreateProjectInstance(); 95ProjectInstance project = projectFromString.Project.CreateProjectInstance(); 147ProjectInstance project = (projectFromString.Project).CreateProjectInstance(); 200ProjectInstance project1 = projectFromString1.Project.CreateProjectInstance(); 201ProjectInstance project2 = projectFromString2.Project.CreateProjectInstance(); 256ProjectInstance project = (projectFromString.Project).CreateProjectInstance(); 305ProjectInstance project = (projectFromString.Project).CreateProjectInstance();
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (33)
Build\ProjectBuildManager.cs (3)
274public Task<MSB.Execution.ProjectInstance> BuildProjectAsync( 285private async Task<MSB.Execution.ProjectInstance> BuildProjectAsync( 290var projectInstance = project.CreateProjectInstance();
MSBuild\CSharp\CSharpCommandLineArgumentReader.cs (2)
12private CSharpCommandLineArgumentReader(MSB.Execution.ProjectInstance project) 17public static ImmutableArray<string> Read(MSB.Execution.ProjectInstance project)
MSBuild\CSharp\CSharpProjectFile.cs (2)
18protected override IEnumerable<MSB.Framework.ITaskItem> GetCompilerCommandLineArgs(MSB.Execution.ProjectInstance executedProject) 21protected override ImmutableArray<string> ReadCommandLineArgs(MSB.Execution.ProjectInstance project)
MSBuild\ProjectFile\CommandLineArgumentReader.cs (2)
16protected readonly MSB.Execution.ProjectInstance Project; 19protected CommandLineArgumentReader(MSB.Execution.ProjectInstance project)
MSBuild\ProjectFile\Extensions.cs (14)
16public static IEnumerable<MSB.Framework.ITaskItem> GetAdditionalFiles(this MSB.Execution.ProjectInstance executedProject) 19public static IEnumerable<MSB.Framework.ITaskItem> GetAnalyzers(this MSB.Execution.ProjectInstance executedProject) 22public static IEnumerable<MSB.Framework.ITaskItem> GetDocuments(this MSB.Execution.ProjectInstance executedProject) 25public static IEnumerable<MSB.Framework.ITaskItem> GetEditorConfigFiles(this MSB.Execution.ProjectInstance executedProject) 28public static IEnumerable<MSB.Framework.ITaskItem> GetMetadataReferences(this MSB.Execution.ProjectInstance executedProject) 31public static IEnumerable<ProjectFileReference> GetProjectReferences(this MSB.Execution.ProjectInstance executedProject) 36public static ImmutableArray<PackageReference> GetPackageReferences(this MSB.Execution.ProjectInstance executedProject) 75public static string? ReadPropertyString(this MSB.Execution.ProjectInstance executedProject, string propertyName) 78public static bool ReadPropertyBool(this MSB.Execution.ProjectInstance executedProject, string propertyName) 81public static int ReadPropertyInt(this MSB.Execution.ProjectInstance executedProject, string propertyName) 84public static ulong ReadPropertyULong(this MSB.Execution.ProjectInstance executedProject, string propertyName) 87public static TEnum? ReadPropertyEnum<TEnum>(this MSB.Execution.ProjectInstance executedProject, string propertyName, bool ignoreCase) 91public static string ReadItemsAsString(this MSB.Execution.ProjectInstance executedProject, string itemType) 109public static IEnumerable<MSB.Framework.ITaskItem> GetTaskItems(this MSB.Execution.ProjectInstance executedProject, string itemType)
MSBuild\ProjectFile\ProjectFile.cs (6)
41protected abstract IEnumerable<MSB.Framework.ITaskItem> GetCompilerCommandLineArgs(MSB.Execution.ProjectInstance executedProject); 42protected abstract ImmutableArray<string> ReadCommandLineArgs(MSB.Execution.ProjectInstance project); 109var project = await _buildManager.BuildProjectAsync(_loadedProject, Log, cancellationToken).ConfigureAwait(false); 116private ProjectFileInfo CreateProjectFileInfo(MSB.Execution.ProjectInstance project) 212private static ImmutableArray<string> GetContentFiles(MSB.Execution.ProjectInstance project) 220private ImmutableArray<string> GetCommandLineArgs(MSB.Execution.ProjectInstance project)
MSBuild\VisualBasic\VisualBasicCommandLineArgumentReader.cs (2)
14public VisualBasicCommandLineArgumentReader(MSB.Execution.ProjectInstance project) 19public static ImmutableArray<string> Read(MSB.Execution.ProjectInstance project)
MSBuild\VisualBasic\VisualBasicProjectFile.cs (2)
18protected override IEnumerable<MSB.Framework.ITaskItem> GetCompilerCommandLineArgs(MSB.Execution.ProjectInstance executedProject) 21protected override ImmutableArray<string> ReadCommandLineArgs(MSB.Execution.ProjectInstance project)
MSBuild (2)
JsonOutputFormatter.cs (1)
46internal void AddItemInstancesInJsonFormat(string[] itemNames, ProjectInstance project)
XMake.cs (1)
1109ProjectInstance builtProject = result.ProjectStateAfterBuild;