Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,12 @@ private static bool FindInGac(string gacRoot, AssemblyName assemblyName, out str
if (Directory.Exists(tempAssemblyDirPath))
{
// Enumerate all directories, sort by name and select the last. This selects the latest version.
var chosenVersionDirectory = Directory.GetDirectories(tempAssemblyDirPath).OrderBy(d => d).LastOrDefault();
var chosenVersionDirectory = Directory.EnumerateDirectories(tempAssemblyDirPath).OrderBy(d => d).LastOrDefault();

if (!string.IsNullOrEmpty(chosenVersionDirectory))
{
// Select first or default as the directory will contain only one assembly. If nothing then default is null;
var foundAssemblyPath = Directory.GetFiles(chosenVersionDirectory, $"{assemblyName.Name}*").FirstOrDefault();
var foundAssemblyPath = Directory.EnumerateFiles(chosenVersionDirectory, $"{assemblyName.Name}*").FirstOrDefault();

if (!string.IsNullOrEmpty(foundAssemblyPath))
{
Expand Down