Changeset 8331 for branches/ScatterSearch (trunk integration)/HeuristicLab.PluginInfrastructure/3.3/Manager/PluginValidator.cs
- Timestamp:
- 07/26/12 09:51:13 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.PluginInfrastructure/3.3/Manager/PluginValidator.cs
r7259 r8331 506 506 foreach (var desc in PluginDescriptionIterator.IterateDependenciesBottomUp(pluginDescriptions 507 507 .Where(x => x.PluginState != PluginState.Disabled))) { 508 // store the assembly names so that we can later retrieve the assemblies loaded in the appdomain by name 509 var assemblyNames = new List<string>(); 508 510 foreach (string assemblyLocation in desc.AssemblyLocations) { 509 511 if (desc.PluginState != PluginState.Disabled) { … … 515 517 // this can still lead to an exception 516 518 // even when the assemby was successfully loaded into the reflection only context before 517 var asm = Assembly.Load(assemblyName); 519 // when loading the assembly using it's assemblyName it can be loaded from a different location than before (e.g. the GAC) 520 Assembly.Load(assemblyName); 521 assemblyNames.Add(assemblyName); 518 522 } 519 523 catch (BadImageFormatException) { … … 535 539 } 536 540 } 541 desc.AssemblyNames = assemblyNames; 537 542 } 538 543 } … … 547 552 if (desc.PluginState == PluginState.Enabled) { 548 553 // cannot use ApplicationManager to retrieve types because it is not yet instantiated 549 foreach (string assembly Location in desc.AssemblyLocations) {554 foreach (string assemblyName in desc.AssemblyNames) { 550 555 var asm = (from assembly in assemblies 551 where string.Equals(Path.GetFullPath(assembly.Location), Path.GetFullPath(assemblyLocation), StringComparison.CurrentCultureIgnoreCase)556 where assembly.FullName == assemblyName 552 557 select assembly) 553 .Single ();554 558 .SingleOrDefault(); 559 if (asm == null) throw new InvalidPluginException("Could not load assembly " + assemblyName + " for plugin " + desc.Name); 555 560 foreach (Type pluginType in asm.GetTypes()) { 556 561 if (typeof(IPlugin).IsAssignableFrom(pluginType) && !pluginType.IsAbstract && !pluginType.IsInterface && !pluginType.HasElementType) {
Note: See TracChangeset
for help on using the changeset viewer.