Skip to content
This repository was archived by the owner on Nov 9, 2026. It is now read-only.
Merged
Changes from all commits
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 @@ -124,16 +124,16 @@ public bool AddToCache (AssemblyDefinition assembly)

public virtual AssemblyDefinition? Load (string fileName, bool forceLoad = false)
{
if (!File.Exists (fileName))
return null;

AssemblyDefinition? assembly = null;
var name = Path.GetFileNameWithoutExtension (fileName);
if (!forceLoad && cache.TryGetValue (name, out assembly))
return assembly;

try {
assembly = ReadAssembly (fileName);
} catch (Exception e) when (e is FileNotFoundException || e is DirectoryNotFoundException) {
// These are ok, we can return null
return null;
} catch (Exception e) {
Diagnostic.Error (9, e, Localization.Resources.CecilResolver_XA0009, fileName);
}
Expand All @@ -144,8 +144,8 @@ public bool AddToCache (AssemblyDefinition assembly)
protected virtual AssemblyDefinition ReadAssembly (string file)
{
bool haveDebugSymbols = loadDebugSymbols &&
(File.Exists (file + ".mdb") ||
File.Exists (Path.ChangeExtension (file, ".pdb")));
(File.Exists (Path.ChangeExtension (file, ".pdb")) ||
File.Exists (file + ".mdb"));
var reader_parameters = new ReaderParameters () {
ApplyWindowsRuntimeProjections = loadReaderParameters.ApplyWindowsRuntimeProjections,
AssemblyResolver = this,
Expand Down