Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ namespace Microsoft.DotNet.ApiSymbolExtensions
/// </summary>
public class AssemblySymbolLoader : IAssemblySymbolLoader
{
// This is a list of dangling .NET Framework internal assemblies that should never get loaded.
private static readonly HashSet<string> s_assembliesToIgnore = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you obtain this list?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eric gave me the list but the tool and the command that generated is C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8>\tools\verifyClosure\verifyClosure.exe .\

"System.ServiceModel.Internals.dll",
"Microsoft.Internal.Tasks.Dataflow.dll",
"MSDATASRC.dll",
"ADODB.dll",
"Microsoft.StdFormat.dll",
"stdole.dll",
"PresentationUI.dll",
"Microsoft.VisualBasic.Activities.Compiler.dll",
"SMDiagnostics.dll",
"System.Xaml.Hosting.dll",
"Microsoft.Transactions.Bridge.dll",
"Microsoft.Workflow.Compiler.dll"
];

private readonly ILog _log;
// Dictionary that holds the paths to help loading dependencies. Keys will be assembly name and
// value are the containing folder.
Expand Down Expand Up @@ -341,11 +357,14 @@ private void ResolveReferences(PEReader peReader, ImmutableHashSet<string>? refe
AssemblyReference reference = reader.GetAssemblyReference(handle);
string name = $"{reader.GetString(reference.Name)}.dll";

// Skip assemblies that should never get loaded because they are purely internal
if (s_assembliesToIgnore.Contains(name))
continue;

// Skip reference assemblies that are loaded later.
if (referenceAssemblyNamesToIgnore != null && referenceAssemblyNamesToIgnore.Contains(name))
continue;


// If the assembly reference is already loaded, don't do anything.
if (_loadedAssemblies.ContainsKey(name))
continue;
Expand Down
Loading