Skip to content

Commit 8d8ebea

Browse files
authored
Merge pull request github#12067 from michaelnebel/csharp/reflectionload
C#: Delete dead assembly load code.
2 parents 968f588 + 470e4b6 commit 8d8ebea

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

csharp/extractor/Semmle.Extraction.CSharp.Standalone/AssemblyCache.cs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -106,36 +106,6 @@ public AssemblyInfo ResolveReference(string id)
106106
return result;
107107
}
108108

109-
// Attempt to load the reference from the GAC.
110-
try
111-
{
112-
var loadedAssembly = System.Reflection.Assembly.ReflectionOnlyLoad(id);
113-
114-
if (loadedAssembly is not null)
115-
{
116-
// The assembly was somewhere we haven't indexed before.
117-
// Add this assembly to our index so that subsequent lookups are faster.
118-
119-
result = AssemblyInfo.MakeFromAssembly(loadedAssembly);
120-
assemblyInfoById[id] = result;
121-
assemblyInfoByFileName[loadedAssembly.Location] = result;
122-
return result;
123-
}
124-
}
125-
catch (FileNotFoundException)
126-
{
127-
// A suitable assembly could not be found
128-
}
129-
catch (FileLoadException)
130-
{
131-
// The assembly cannot be loaded for some reason
132-
// e.g. The name is malformed.
133-
}
134-
catch (PlatformNotSupportedException)
135-
{
136-
// .NET Core does not have a GAC.
137-
}
138-
139109
// Fallback position - locate the assembly by its lower-case name only.
140110
var asmName = assemblyName.ToLowerInvariant();
141111

0 commit comments

Comments
 (0)