Skip to content

Commit 023e459

Browse files
Update RunCommandSelector.cs
1 parent 24d069a commit 023e459

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Cli/dotnet/Commands/Run/RunCommandSelector.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ internal sealed class RunCommandSelector : IDisposable
3131

3232
private ProjectCollection? _collection;
3333
private Microsoft.Build.Evaluation.Project? _project;
34-
private ProjectInstance? _projectInstance;
3534

3635
/// <summary>
3736
/// Gets whether the selector has a valid project that can be evaluated.
@@ -107,7 +106,6 @@ public void InvalidateGlobalProperties(Dictionary<string, string> updatedPropert
107106

108107
// Dispose existing project to force re-evaluation
109108
_project = null;
110-
_projectInstance = null;
111109
_collection?.Dispose();
112110
_collection = null;
113111
HasValidProject = false;
@@ -133,8 +131,7 @@ private bool OpenProjectIfNeeded([NotNullWhen(true)] out ProjectInstance? projec
133131
loggers: null,
134132
toolsetDefinitionLocations: ToolsetDefinitionLocations.Default);
135133
_project = _collection.LoadProject(_projectFilePath);
136-
_projectInstance = _project.CreateProjectInstance();
137-
projectInstance = _projectInstance;
134+
projectInstance = _project.CreateProjectInstance();
138135
HasValidProject = true;
139136
return true;
140137
}

0 commit comments

Comments
 (0)