0

我试图在Windows机器上使用Visual Studio 2015远程调试Raspberry Pi 3(运行Raspbian Jessie)上的C#.NET 4.5 WinForms应用程序。如何使用Visual Studio 2015远程调试Raspberry Pi 3上的C#.NET 4.5 WinForms应用程序?

据我所知,我可以使用MonoRemoteDebugger这个。我安装了Visual Studio扩展并在Pi上运行服务器程序,但是当我尝试调试应用程序时,MonoRemoteDebugger.Server.exe程序显示来自pdb2mdb.exe程序的错误。以下是错误:

Fatal error: Microsoft.Cci.Pdb.PdbDebugException: Unknown custom metadata item kind: 6 at Microsoft.Cci.Pdb.PdbFunction.ReadCustomMetadata (Microsoft.Cci.Pdb.BitAccess bits) [0x00000] in :0
at Microsoft.Cci.Pdb.PdbFunction..ctor (System.String module, ManProcSym proc, Microsoft.Cci.Pdb.BitAccess bits) [0x00000] in :0 at Microsoft.Cci.Pdb.PdbFunction.LoadManagedFunctions (System.String module, Microsoft.Cci.Pdb.BitAccess bits, UInt32 limit, 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 names, System.Collections.ArrayList funcList, Boolean readStrings, Microsoft.Cci.Pdb.MsfDirectory dir, System.Collections.Generic.Dictionary`2 nameIndex, Microsoft.Cci.Pdb.PdbReader reader) [0x00000] in :0 at Microsoft.Cci.Pdb.PdbFile.LoadFunctions (System.IO.Stream read, Microsoft.Cci.Pdb.BitAccess bits, Boolean readAllStrings) [0x00000] in :0 at Microsoft.Cci.Pdb.PdbFile.LoadFunctions (System.IO.Stream read, Boolean readAllStrings) [0x00000] in :0 at Pdb2Mdb.Driver.Convert (Mono.Cecil.AssemblyDefinition assembly, System.IO.Stream pdb, Mono.CompilerServices.SymbolWriter.MonoSymbolWriter mdb) [0x00000] in :0

我试着运行在郫县命令“pdb2mdb MyProgram.exe”,所以它看来,问题出在pdb2mdb.exe程序它产生同样的错误。随着一些挖掘,我发现这似乎是Mono.Cecil中的一个bug,它在版本0.9.6中为was fixed,但它似乎是可用于Raspian Jessie的最新版本是0.9.5。

我试着只是the one from here更换pdb2mdb.exe,然后将错误更改为:

Unhandled Exception: System.TypeLoadException: Could not load type 'Mono.Cecil.AssemblyDefinition' from assembly 'pdb2mdb, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'Mono.Cecil.AssemblyDefinition' from assembly 'pdb2mdb, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

是试图得到淠较新版本Mono.Cecil能解决?如果是这样,我该怎么做,以及确保pdb2mdb.exe引用新版本?

回答

1

我已经解决了这个问题!

第一个问题是与pdb2mdb.exe。从mono-project.com的喘息包源时,必须使用使用这些命令来获得最新的单包:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF 
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list 
sudo apt-get update 
sudo apt-get install mono-complete mono-devel 

之后,MonoRemoteDebugger在Visual Studio中显示以下错误:

Unable to start program 'C:\Test1\Test1.exe'.

The located assembly's manifest definition does not match the assembly reference.

要解决这个问题,我删除了MonoRemoteDebugger 1.0.5 Visual Studio扩展,并安装了version 1.0.4,它没有这个问题。

相关问题