diff --git a/src/Docfx.Dotnet/CompilationHelper.cs b/src/Docfx.Dotnet/CompilationHelper.cs index 97e9b3232ce..47da38b3fcb 100644 --- a/src/Docfx.Dotnet/CompilationHelper.cs +++ b/src/Docfx.Dotnet/CompilationHelper.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. + using Docfx.Common; using Docfx.Exceptions; using ICSharpCode.Decompiler.Metadata; @@ -102,12 +103,17 @@ public static Compilation CreateCompilationFromVBCode(string code, IDictionary(); - foreach (var member in symbol.GetMembers().Where(s => s is not INamedTypeSymbol)) + foreach ( + var member in symbol.GetMembers() + .Where(static s => + s is not INamedTypeSymbol + && ! s.Name.StartsWith('<') + && (s is not IMethodSymbol ms || ms.MethodKind != MethodKind.StaticConstructor) + )) { var memberItem = member.Accept(this); if (memberItem != null)