Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2533


Ignore:
Timestamp:
11/25/09 15:07:53 (15 years ago)
Author:
mkommend
Message:

added try catch block while querying the loaded assemblies (ticket #807)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Programmable/3.2/ProgrammableOperator.cs

    r1530 r2533  
    109109      parameters.IncludeDebugInformation = false;
    110110      Assembly[] loadedAssemblies = AppDomain.CurrentDomain.GetAssemblies();
    111       foreach (Assembly loadedAssembly in loadedAssemblies)
    112         parameters.ReferencedAssemblies.Add(loadedAssembly.Location);
     111      foreach (Assembly loadedAssembly in loadedAssemblies) {
     112        try {
     113          parameters.ReferencedAssemblies.Add(loadedAssembly.Location);
     114        }
     115        catch (NotSupportedException) {
     116          //NotSupportedException is thrown while accessing the Location property of the anonymously hosted dynamic methods assembly,
     117          //which is related to LINQ queries
     118        }
     119      }
    113120      parameters.ReferencedAssemblies.Add(typeof(Enumerable).Assembly.Location); // add reference to version 3.5 of System.dll
    114121      parameters.ReferencedAssemblies.Add(typeof(DataContext).Assembly.Location); // add reference System.Data.Linq.Dll
Note: See TracChangeset for help on using the changeset viewer.