Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/23/19 20:27:38 (5 years ago)
Author:
gkronber
Message:

#2435: merged r17037 and r17110 from trunk to stable

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Scripting/3.3/Script.cs

    r17097 r17158  
    2929using System.Reflection;
    3030using System.Text;
     31using System.Text.RegularExpressions;
     32using HEAL.Attic;
    3133using HeuristicLab.Common;
    3234using HeuristicLab.Common.Resources;
    3335using HeuristicLab.Core;
    34 using HEAL.Attic;
    3536using Microsoft.CSharp;
    3637
     
    122123
    123124    public virtual IEnumerable<Assembly> GetAssemblies() {
    124       var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && File.Exists(a.Location)).ToList();
     125      var assemblies = AppDomain.CurrentDomain.GetAssemblies()
     126        .Where(a => !a.IsDynamic && File.Exists(a.Location))
     127        .GroupBy(x => Regex.Replace(Path.GetFileName(x.Location), @"-[\d.]+\.dll$", ""))
     128        .Select(x => x.OrderByDescending(y => y.GetName().Version).First())
     129        .ToList();
    125130      assemblies.Add(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly); // for dlr functionality
    126131      return assemblies;
Note: See TracChangeset for help on using the changeset viewer.