@@ -12,7 +12,6 @@ namespace Ninject.Modules
1212 using System . Collections . Generic ;
1313 using System . IO ;
1414 using System . Linq ;
15- using System . Reflection ;
1615 using Ninject . Components ;
1716 using Ninject . Infrastructure ;
1817
@@ -21,8 +20,6 @@ namespace Ninject.Modules
2120 /// </summary>
2221 public class ModuleLoader : NinjectComponent , IModuleLoader
2322 {
24- private static readonly string CurrentAssemblyDirectory = Path . GetDirectoryName ( new Uri ( typeof ( ModuleLoader ) . Assembly . CodeBase ) . LocalPath ) ;
25-
2623 /// <summary>
2724 /// Initializes a new instance of the <see cref="ModuleLoader"/> class.
2825 /// </summary>
@@ -56,8 +53,15 @@ public void LoadModules(IEnumerable<string> patterns)
5653 var extension = fileGroup . Key ;
5754 var plugin = plugins . Where ( p => p . SupportedExtensions . Contains ( extension ) ) . FirstOrDefault ( ) ;
5855
56+ Console . WriteLine ( fileGroup . Key ) ;
57+
5958 if ( plugin != null )
6059 {
60+ foreach ( var f in fileGroup )
61+ {
62+ Console . WriteLine ( f ) ;
63+ }
64+
6165 plugin . LoadModules ( fileGroup ) ;
6266 }
6367 }
@@ -79,14 +83,13 @@ private static IEnumerable<string> NormalizePaths(string path)
7983
8084 private static IEnumerable < string > GetBaseDirectories ( )
8185 {
82- var baseDirectory = Path . GetDirectoryName ( AppDomain . CurrentDomain . BaseDirectory ) ;
86+ var baseDirectory = AppDomain . CurrentDomain . BaseDirectory ;
8387 var searchPath = AppDomain . CurrentDomain . RelativeSearchPath ;
8488
85- return ( string . IsNullOrEmpty ( searchPath )
89+ return string . IsNullOrEmpty ( searchPath )
8690 ? new [ ] { baseDirectory }
8791 : searchPath . Split ( new [ ] { Path . PathSeparator } , StringSplitOptions . RemoveEmptyEntries )
88- . Select ( path => Path . Combine ( baseDirectory , path ) ) )
89- . Concat ( new [ ] { CurrentAssemblyDirectory } ) . Distinct ( ) ;
92+ . Select ( path => Path . Combine ( baseDirectory , path ) ) ;
9093 }
9194 }
9295}
0 commit comments