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,它沒有這個問題。

相關問題