Skip to content
This repository was archived by the owner on Mar 20, 2019. It is now read-only.

Commit 3c09e09

Browse files
committed
Fixed sample project downgrade to remove EnlistmentInfo imports that aren't supported in MSBuild v3.5.
1 parent f3ebcb7 commit 3c09e09

4 files changed

Lines changed: 7 additions & 1 deletion

File tree

lib/DotNetOpenAuth.BuildTasks.dll

1 KB
Binary file not shown.

lib/DotNetOpenAuth.BuildTasks.pdb

0 Bytes
Binary file not shown.

src/DotNetOpenAuth.BuildTasks/DotNetOpenAuth.BuildTasks.sln

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1313
..\..\tools\DotNetOpenAuth.targets = ..\..\tools\DotNetOpenAuth.targets
1414
..\..\tools\DotNetOpenAuth.Versioning.targets = ..\..\tools\DotNetOpenAuth.Versioning.targets
1515
..\..\tools\drop.proj = ..\..\tools\drop.proj
16+
..\..\EnlistmentInfo.props = ..\..\EnlistmentInfo.props
17+
..\..\EnlistmentInfo.targets = ..\..\EnlistmentInfo.targets
1618
..\..\tools\ohloh.proj = ..\..\tools\ohloh.proj
1719
..\..\projecttemplates\projecttemplates.proj = ..\..\projecttemplates\projecttemplates.proj
1820
..\..\samples\Samples.proj = ..\..\samples\Samples.proj

src/DotNetOpenAuth.BuildTasks/DowngradeProjects.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ public override bool Execute() {
4949
}
5050
}
5151

52-
// Web projects usually have an import that includes these substrings
52+
// MSBuild v3.5 doesn't support the GetDirectoryNameOfFileAbove function
53+
var enlistmentInfoImports = project.Imports.Cast<Import>().Where(i => i.ProjectPath.IndexOf("[MSBuild]::GetDirectoryNameOfFileAbove", StringComparison.OrdinalIgnoreCase) >= 0);
54+
enlistmentInfoImports.ToList().ForEach(i => project.Imports.RemoveImport(i));
55+
56+
// Web projects usually have an import that includes these substrings));)
5357
foreach (Import import in project.Imports) {
5458
import.ProjectPath = import.ProjectPath
5559
.Replace("$(MSBuildExtensionsPath32)", "$(MSBuildExtensionsPath)")

0 commit comments

Comments
 (0)