+ // The first value of search_paths can be the parent assembly directory.
+ // In that case the value would be treated as a directory.
+ // This code checks if we should treat the value as a TargetFramework assembly.
+ // Doing so avoids CopyLocal beeing set to true.
+ if (spath_index++ == 0 && targetFrameworkDirectories != null) {
+ foreach (string fpath in targetFrameworkDirectories) {
+ if (string.IsNullOrEmpty (fpath))
+ continue;
+ if (String.Compare (
+ Path.GetFullPath (spath).TrimEnd (Path.DirectorySeparatorChar),
+ Path.GetFullPath (fpath).TrimEnd (Path.DirectorySeparatorChar),
+ StringComparison.InvariantCulture) != 0)
+ continue;
+
+ resolved = assembly_resolver.FindInTargetFramework (item,
+ fpath, specific_version);
+
+ break;
+ }
+
+ if (resolved != null)
+ break;
+ }
+