System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at ICSharpCode.Decompiler.DebugInfo.PortablePdbWriter.<>c__DisplayClass2_0.<WritePdb>g__ProcessMethod|7(MethodDefinitionHandle method, DocumentHandle document, List`1 sequencePoints, SyntaxTree syntaxTree) in C:\Source\GitHub\ILSpy\ICSharpCode.Decompiler\DebugInfo\PortablePdbWriter.cs:line 220
at ICSharpCode.Decompiler.DebugInfo.PortablePdbWriter.WritePdb(PEFile file, CSharpDecompiler decompiler, DecompilerSettings settings, Stream targetStream, Boolean noLogo) in C:\Source\GitHub\ILSpy\ICSharpCode.Decompiler\DebugInfo\PortablePdbWriter.cs:line 116
at ICSharpCode.ILSpy.GeneratePdbContextMenuEntry.<>c__DisplayClass3_0.<GeneratePdbForAssembly>b__2() in C:\Source\GitHub\ILSpy\ILSpy\Commands\GeneratePdbContextMenuEntry.cs:line 81
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
I found that #2177 has been fixed in ILSpy
6.3.0.6139-preview1, sweet. While further trying PDB generation with different C# version options, found there is another issue occurred both in ILSpy6.2.0.6124, &6.3.0.6139-preview1.Steps to reproduce
Newtonsoft.Json.dll 12.0.3by setting C# Version toC# 2.0,C# 3.0,C# 4,0,C# 5.0orC# 6.0each time. Both ILSpy6.2.0.6124, &6.3.0.6139-preview1throwSystem.ArgumentException: An item with the same key has already been added..C# 1.0,C# 7.0,C# 7.1,C# 7.2,C# 7.3,C# 8.0, orC# 9.0), PDB generation works fine.Error message shown
Details