Skip to content

Commit

Permalink
Use ProjectInstance.FromFile instead of Project.FromFile + Project.Cr…
Browse files Browse the repository at this point in the history
…eateInstance
  • Loading branch information
dfederm committed Mar 15, 2022
1 parent 3d301ae commit fa15f2e
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -930,12 +930,7 @@ private ICollection<ProjectWithInnerNodes> LoadProjects(IEnumerable<ProjectGraph
LoadSettings = ProjectLoadSettings.IgnoreEmptyImports | ProjectLoadSettings.IgnoreInvalidImports | ProjectLoadSettings.IgnoreMissingImports | ProjectLoadSettings.DoNotEvaluateElementsWithFalseCondition,
ProjectCollection = collection
};
// Create a Project object which does the evaluation
var project = Project.FromFile(path, projectOptions);
// Create a ProjectInstance object which is what this factory needs to return
var projectInstance = project.CreateProjectInstance(ProjectInstanceSettings.None, evaluationContext);
var projectInstance = ProjectInstance.FromFile(path, projectOptions);
if (!projectInstance.Targets.ContainsKey("_IsProjectRestoreSupported") || properties.TryGetValue("TargetFramework", out var targetFramework) && string.IsNullOrWhiteSpace(targetFramework))
{
Expand Down

0 comments on commit fa15f2e

Please sign in to comment.