From 082f532a69a074d5089222ea354a8f6c71a3f8ec Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Sat, 7 Jan 2012 17:55:40 +0000 Subject: [PATCH] Fix assemblies not being resolved when a MSBuild project defines a reference search path via a PropertyGroup/ReferencePath which defines the path using $(SolutionDir). --- src/Main/Base/Project/Src/Project/Solution/Solution.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Main/Base/Project/Src/Project/Solution/Solution.cs b/src/Main/Base/Project/Src/Project/Solution/Solution.cs index 73c7e58932..05926d5218 100644 --- a/src/Main/Base/Project/Src/Project/Solution/Solution.cs +++ b/src/Main/Base/Project/Src/Project/Solution/Solution.cs @@ -317,6 +317,7 @@ namespace ICSharpCode.SharpDevelop.Project changeWatcher.Disable(); changeWatcher.Rename(fileName); this.fileName = fileName; + UpdateMSBuildProperties(); string outputDirectory = Path.GetDirectoryName(fileName); if (!System.IO.Directory.Exists(outputDirectory)) { System.IO.Directory.CreateDirectory(outputDirectory); @@ -1173,11 +1174,12 @@ namespace ICSharpCode.SharpDevelop.Project public static Solution Load(string fileName) { Solution newSolution = new Solution(new ProjectChangeWatcher(fileName)); - solutionBeingLoaded = newSolution; + solutionBeingLoaded = newSolution; newSolution.Name = Path.GetFileNameWithoutExtension(fileName); string extension = Path.GetExtension(fileName).ToUpperInvariant(); newSolution.fileName = fileName; + newSolution.UpdateMSBuildProperties(); newSolution.isLoading = true; try { if (!SetupSolution(newSolution)) { @@ -1190,6 +1192,12 @@ namespace ICSharpCode.SharpDevelop.Project solutionBeingLoaded = null; return newSolution; } + + void UpdateMSBuildProperties() + { + MSBuildProjectCollection.SetGlobalProperty("SolutionDir", Directory); + } + #endregion #region System.IDisposable interface implementation