Skip to content

Commit 45081a6

Browse files
committed
Fix the issue where PDBs generated by ILSpy do not match certain assemblies.
1 parent 55d8404 commit 45081a6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ICSharpCode.Decompiler/DebugInfo/PortablePdbWriter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,9 @@ string BuildFileNameFromTypeName(TypeDefinitionHandle handle)
235235

236236
if (pdbId == null)
237237
{
238-
var debugDir = file.Reader.ReadDebugDirectory().FirstOrDefault(dir => dir.Type == DebugDirectoryEntryType.CodeView);
238+
var debugDir = file.Reader.ReadDebugDirectory().LastOrDefault(dir => dir.Type == DebugDirectoryEntryType.CodeView);
239239
var portable = file.Reader.ReadCodeViewDebugDirectoryData(debugDir);
240+
Debug.Assert(!portable.Path.EndsWith(".ni.pdb"));
240241
pdbId = new BlobContentId(portable.Guid, debugDir.Stamp);
241242
}
242243

0 commit comments

Comments
 (0)