From: Ankit Jain Date: Thu, 3 Nov 2011 15:32:09 +0000 (+0530) Subject: [xbuild] Pick the correct base path for target frameworks. X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=bd00987862b8a33df6148a87dd226ef51f360408 [xbuild] Pick the correct base path for target frameworks. Don't depend on Environment.GacPath to figure out the framework base path ("..../xbuild-frameworks"). This broke on fedora, where it mapped to $prefix/lib/mono instead of $prefix/lib64/mono . Which caused framework assemblies to be picked from "lib" instead of "lib64". --- diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetReferenceAssemblyPaths.cs b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetReferenceAssemblyPaths.cs index 796296e35bd..138594a60de 100644 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetReferenceAssemblyPaths.cs +++ b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetReferenceAssemblyPaths.cs @@ -227,18 +227,9 @@ namespace Microsoft.Build.Tasks static string DefaultFrameworksBasePath { get { - if (framework_base_path == null) { - // NOTE: code from mcs/tools/gacutil/driver.cs - PropertyInfo gac = typeof (System.Environment).GetProperty ( - "GacPath", BindingFlags.Static | BindingFlags.NonPublic); - - if (gac != null) { - MethodInfo get_gac = gac.GetGetMethod (true); - string gac_path = (string) get_gac.Invoke (null, null); - framework_base_path = Path.GetFullPath (Path.Combine ( - gac_path, Path.Combine ("..", "xbuild-frameworks"))); - } - } + if (framework_base_path == null) + framework_base_path = Path.Combine (Path.GetDirectoryName (typeof (object).Assembly.Location), + Path.Combine ("..", "xbuild-frameworks")); return framework_base_path; } }