Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 6b9f674

Browse files
committed
[MSBuild] Fix search path evaluation issue
When evaluating an import for several different paths, make sure the property assignments required for the different evaluations are temporary, and don't have an effect on the global evaluation context.
1 parent b4c75c9 commit 6b9f674

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/DefaultMSBuildEngine.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,7 +988,7 @@ string[] GetImportFiles (ProjectInfo project, MSBuildEvaluationContext context,
988988
if (pathPropertyValue != null) {
989989
var tempCtx = new MSBuildEvaluationContext (context);
990990
var mep = MSBuildProjectService.ToMSBuildPath (null, pathPropertyValue);
991-
tempCtx.SetPropertyValue (pathProperty, mep);
991+
tempCtx.SetContextualPropertyValue (pathProperty, mep);
992992
context = tempCtx;
993993
}
994994

main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildEvaluationContext.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ public void SetPropertyValue (string name, string value)
327327
properties [name] = value;
328328
}
329329

330+
public void SetContextualPropertyValue (string name, string value)
331+
{
332+
// Sets a properly value only for the scope of this context, not for the scope of the global evaluation operation
333+
properties [name] = value;
334+
}
335+
330336
public void ClearPropertyValue (string name)
331337
{
332338
properties.Remove (name);

0 commit comments

Comments
 (0)