Changeset 11477
- Timestamp:
- 10/17/14 10:44:42 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Scripting/3.3/Script.cs
r10857 r11477 24 24 using System.CodeDom.Compiler; 25 25 using System.Collections.Generic; 26 using System.Diagnostics; 26 27 using System.Drawing; 27 28 using System.IO; … … 142 143 143 144 public virtual IEnumerable<Assembly> GetAssemblies() { 144 var assemblies = new List<Assembly>(); 145 foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) { 146 try { 147 if (File.Exists(a.Location)) assemblies.Add(a); 148 } catch (NotSupportedException) { 149 // NotSupportedException is thrown while accessing 150 // the Location property of the anonymously hosted 151 // dynamic methods assembly, which is related to 152 // LINQ queries 153 } 154 } 145 var assemblies = AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && File.Exists(a.Location)).ToList(); 155 146 assemblies.Add(typeof(Microsoft.CSharp.RuntimeBinder.Binder).Assembly); // for dlr functionality 156 147 return assemblies;
Note: See TracChangeset
for help on using the changeset viewer.