diff --git a/src/Nancy.OpenApi/Infrastructure/RouteMetadataProvider.cs b/src/Nancy.OpenApi/Infrastructure/RouteMetadataProvider.cs index 1d75e56..0d672d8 100644 --- a/src/Nancy.OpenApi/Infrastructure/RouteMetadataProvider.cs +++ b/src/Nancy.OpenApi/Infrastructure/RouteMetadataProvider.cs @@ -45,7 +45,7 @@ private static Type GetModuleMetadataType(INancyModule module) if (ModuleTypes.TryGetValue(metadataName, out type)) return type; type = AppDomain.CurrentDomain.GetAssemblies() - .SelectMany(x => x.GetTypes()) + .SelectMany(x => x.SafeGetTypes()) .FirstOrDefault(x => x.Name == metadataName); ModuleTypes.Add(metadataName, type); @@ -57,4 +57,4 @@ private static Type GetModuleMetadataType(INancyModule module) private static readonly Dictionary MetadataItems = new Dictionary(); private readonly TinyIoCContainer _container; } -} \ No newline at end of file +}