Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
scott-xu committed Sep 16, 2017
1 parent aff9b01 commit 085b924
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Ninject/Infrastructure/Language/ExtensionsForAssembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ public static bool HasNinjectModules(this Assembly assembly)
/// <returns>The loadable <see cref="INinjectModule"/>s</returns>
public static IEnumerable<INinjectModule> GetNinjectModules(this Assembly assembly)
{
return assembly.ExportedTypes.Where(IsLoadableModule)
.Select(type => Activator.CreateInstance(type) as INinjectModule);
return assembly.IsDynamic ?
Enumerable.Empty<INinjectModule>() :
assembly.ExportedTypes.Where(IsLoadableModule)
.Select(type => Activator.CreateInstance(type) as INinjectModule);
}

private static bool IsLoadableModule(Type type)
Expand Down

0 comments on commit 085b924

Please sign in to comment.