Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3178


Ignore:
Timestamp:
03/22/10 16:50:11 (15 years ago)
Author:
gkronber
Message:

Fixed #940 (Plugin infrastructure events show assembly file version instead of plugin version)

File:
1 edited

Legend:

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

    r3081 r3178  
    143143        ApplicationAttribute attr = (from x in appType.GetCustomAttributes(typeof(ApplicationAttribute), false)
    144144                                     select (ApplicationAttribute)x).Single();
     145        var declaringPlugin = GetDeclaringPlugin(appType, plugins);
    145146        ApplicationDescription info = new ApplicationDescription();
    146147        info.Name = application.Name;
    147         info.Version = appType.Assembly.GetName().Version;
     148        info.Version = declaringPlugin.Version;
    148149        info.Description = application.Description;
    149150        info.AutoRestart = attr.RestartOnErrors;
     
    544545    }
    545546
     547    private PluginDescription GetDeclaringPlugin(Type appType, IEnumerable<PluginDescription> plugins) {
     548      return (from p in plugins
     549              from asmLocation in p.AssemblyLocations
     550              where Path.GetFullPath(asmLocation).Equals(Path.GetFullPath(appType.Assembly.Location), StringComparison.CurrentCultureIgnoreCase)
     551              select p).Single();
     552    }
     553
    546554    // register assembly in the assembly cache for the ReflectionOnlyAssemblyResolveEvent
    547555    private void RegisterLoadedAssembly(Assembly asm) {
Note: See TracChangeset for help on using the changeset viewer.