Weaver: ILPostProcessorAssemblyResolver FindFile comments

This commit is contained in:
mischa 2023-06-19 21:46:24 +08:00 committed by mischa
parent 5b7d9560c0
commit 1cc888f287

View File

@ -131,11 +131,15 @@ string FindFile(string name)
string exeName = name + ".exe";
// perhaps the type comes from a dll
// caching assemblyReferences.Select(Path.GetFileName) in constructor
// would throw FileNotFoundExceptions in some large projects!
string fileName = assemblyReferences.FirstOrDefault(r => Path.GetFileName(r) == dllName);
if (fileName != null)
return fileName;
// perhaps the type comes from an exe instead
// caching assemblyReferences.Select(Path.GetFileName) in constructor
// would throw FileNotFoundExceptions in some large projects!
fileName = assemblyReferences.FirstOrDefault(r => Path.GetFileName(r) == exeName);
if (fileName != null)
return fileName;