[xbuild] for resolving assemblies from pkg-config, prefer specified version
authorAtsushi Eno <atsushieno@gmail.com>
Thu, 7 May 2015 07:25:32 +0000 (16:25 +0900)
committerAtsushi Eno <atsushieno@gmail.com>
Thu, 7 May 2015 07:25:32 +0000 (16:25 +0900)
... even if SpecificVersion is false. There is no reason to prefer any
mismatching version when SpecificVersion=false.

That behavior caused monodevelop build failures because of incorrectly-
resolved gtk# packages. After this fix, this issue goes away.
https://github.com/mono/monodevelop/blob/2436ad1874694ec811871dacf9a659a79b5fad0d/README.md#known-problems

mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/AssemblyResolver.cs

index 9c1d478eb180fa0e5ef3be87c4ffc32cd96388b5..bf14075f7ff0dd040cf264e7dca6a96a9c4300fd 100644 (file)
@@ -256,9 +256,8 @@ namespace Microsoft.Build.Tasks {
                {
                        PackageAssemblyInfo pkg = null;
 
-                       if (specific_version) {
-                               pkg = PcCache.GetAssemblyLocation (reference.ItemSpec);
-                       } else {
+                       pkg = PcCache.GetAssemblyLocation (reference.ItemSpec);
+                       if (pkg == null && !specific_version) {
                                // if not specific version, then just match simple name
                                string name = reference.ItemSpec;
                                if (name.IndexOf (',') > 0)