private string GetAssemblyPathFromAssemblyFolders(MsBuildProjectLoader msBuildLoader, BuildItem item) { string spec = GetReferenceDllName(item); string[] assemblyFoldersPaths = FrameworkHelper.GetFrameworkPaths(msBuildLoader.TargetFramework); assemblyFoldersPaths = ReversePaths(assemblyFoldersPaths); string path = FrameworkHelper.GetAssemblyPath(spec, assemblyFoldersPaths); if (File.Exists(path)) { return(path); } assemblyFoldersPaths = FrameworkHelper.GetAssemblyFoldersPaths(msBuildLoader.TargetFramework); path = FrameworkHelper.GetAssemblyPath(spec, assemblyFoldersPaths); if (File.Exists(path)) { return(path); } try { Assembly assembly = Assembly.Load(item.FinalItemSpec); if (assembly != null) { return(assembly.Location); } } catch { } try { Assembly assembly = Assembly.LoadWithPartialName(item.FinalItemSpec); if (assembly != null) { return(assembly.Location); } } catch { } return(string.Empty); }