我正在尝试在 Windows 机器上使用 Visual Studio 2015 在 Raspberry Pi 3(运行 Raspbian Jessie)上远程调试 C# .NET 4.5 WinForms 应用程序。
据我了解,我可以为此使用MonoRemoteDebugger。我已经安装了 Visual Studio 扩展并在 Pi 上运行服务器程序,但是当我尝试调试应用程序时,MonoRemoteDebugger.Server.exe 程序显示来自 pdb2mdb.exe 程序的错误。这是错误:
致命错误:Microsoft.Cci.Pdb.PdbDebugException:未知的自定义元数据项类型:Microsoft.Cci.Pdb.PdbFunction.ReadCustomMetadata(Microsoft.Cci.Pdb.BitAccess 位)[0x00000] 中的 6:0
在 Microsoft.Cci.Pdb.PdbFunction..ctor (System.String 模块,ManProcSym 过程,Microsoft.Cci.Pdb.BitAccess 位)[0x00000] 在 Microsoft.Cci.Pdb.PdbFunction.LoadManagedFunctions (System.String 模块, Microsoft.Cci.Pdb.BitAccess 位, UInt32 限制, Boolean readStrings) [0x00000] in :0 at Microsoft.Cci.Pdb.PdbFile.LoadFuncsFromDbiModule (Microsoft.Cci.Pdb.BitAccess bits, Microsoft.Cci.Pdb.DbiModuleInfo info , Microsoft.Cci.Pdb.IntHashTable 名称, System.Collections.ArrayList funcList, Boolean readStrings, Microsoft.Cci.Pdb.MsfDirectory dir, System.Collections.Generic.Dictionary`2 nameIndex, Microsoft.Cci.Pdb.PdbReader reader) [ 0x00000] 在 Microsoft.Cci.Pdb.PdbFile.LoadFunctions 的 0 中(System.IO.Stream 读取,Microsoft.Cci.Pdb.BitAccess 位,布尔 readAllStrings)[0x00000] 在 Microsoft.Cci.Pdb 的 0 中。PdbFile.LoadFunctions (System.IO.Stream read, Boolean readAllStrings) [0x00000] in :0 at Pdb2Mdb.Driver.Convert (Mono.Cecil.AssemblyDefinition 程序集, System.IO.Stream pdb, Mono.CompilerServices.SymbolWriter.MonoSymbolWriter mdb) [0x00000] 在:0
我试过在 Pi 上运行命令“pdb2mdb MyProgram.exe”,它产生了同样的错误,所以问题似乎出在 pdb2mdb.exe 程序上。经过一番挖掘,我发现这似乎是 Mono.Cecil 中的一个错误,该错误已在 0.9.6 版中修复,但似乎可用于 Raspian Jessie 的最新版本是 0.9.5。
我尝试将 pdb2mdb.exe 替换为此处的那个,然后错误变为:
未处理的异常:System.TypeLoadException:无法从程序集“pdb2mdb,版本=0.0.0.0,文化=中性,PublicKeyToken=null”加载类型“Mono.Cecil.AssemblyDefinition”。[错误] 致命的未处理异常:System.TypeLoadException:无法从程序集“pdb2mdb,版本=0.0.0.0,文化=中性,PublicKeyToken=null”加载类型“Mono.Cecil.AssemblyDefinition”。
尝试在 Pi 上获得更新的 Mono.Cecil 版本的解决方案是什么?如果是这样,我将如何处理,以及确保 pdb2mdb.exe 引用较新版本?