Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/18/11 17:33:41 (14 years ago)
Author:
gkronber
Message:

#1348: added ContainsKey check and throw ArgumentException with a more descriptive error message.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Manager/PluginValidator.cs

    r5652 r6021  
    606606    // register assembly in the assembly cache for the ReflectionOnlyAssemblyResolveEvent
    607607    private void RegisterLoadedAssembly(Assembly asm) {
     608      if (reflectionOnlyAssemblies.ContainsKey(asm.FullName) || reflectionOnlyAssemblies.ContainsKey(asm.GetName().Name)) {
     609        throw new ArgumentException("An assembly with the name " + asm.GetName().Name + " has been registered already.", "asm");
     610      }
    608611      reflectionOnlyAssemblies.Add(asm.FullName, asm);
    609612      reflectionOnlyAssemblies.Add(asm.GetName().Name, asm); // add short name
Note: See TracChangeset for help on using the changeset viewer.