Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/18/11 17:33:41 (12 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/DefaultApplicationManager.cs

    r5903 r6021  
    151151    // register assembly in the assembly cache for the AssemblyResolveEvent
    152152    private void RegisterLoadedAssembly(Assembly asm) {
     153      if (loadedAssemblies.ContainsKey(asm.FullName) || loadedAssemblies.ContainsKey(asm.GetName().Name)) {
     154        throw new ArgumentException("An assembly with the name " + asm.GetName().Name + " has been registered already.", "asm");
     155      }
    153156      loadedAssemblies.Add(asm.FullName, asm);
    154157      loadedAssemblies.Add(asm.GetName().Name, asm); // add short name
Note: See TracChangeset for help on using the changeset viewer.