現在、Google のソリューションでは解決できない問題に直面しています。これまでのところ何も機能していません。Leap Motion コードをコンパイルして Naoqi C# ライブラリをインポートすると、問題なく動作します。実際にコード行でロボットに接続しようとすると、プログラムがクラッシュします。私のプログラムは、任意の CPU 用にビルドするように設定されています。.dll は Leap ライブラリと NaoQi ライブラリで参照され、.dll はデバッグ フォルダーとプロジェクト フォルダーに配置されます。この時点で何が問題なのかわかりません。
ここの誰かがそれを理解できますか?これが機能することをとてもうれしく思います。
最初のエラー メッセージは次のとおりです。中断するか続行するかを尋ねられます。
An unhandled exception of type 'System.BadImageFormatException' occurred in LeapCSharp.NET4.0.dll
Additional information: Could not load file or assembly 'naoqi-dotnet4, Version=1.14.0.218, Culture=neutral, PublicKeyToken=b9b4e24bd78100d6' or one of its dependencies. An attempt was made to load a program with an incorrect format.
いずれにせよ、プログラムはクラッシュします。これは、この時点でのコンソール ログのテキストです。
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\11.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Grace\Documents\Visual Studio 2012\Projects\NaoLeap\NaoLeap\bin\Debug\NaoLeap.vshost.exe'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll'
The thread 'vshost.NotifyLoad' (0x440) has exited with code 0 (0x0).
The thread '<No Name>' (0x1914) has exited with code 0 (0x0).
The thread '<No Name>' (0xa90) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0x1a08) has exited with code 0 (0x0).
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Grace\documents\visual studio 2012\Projects\NaoLeap\NaoLeap\bin\Debug\NaoLeap.exe', Symbols loaded.
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\Accessibility\v4.0_4.0.0.0__b03f5f7f11d50a3a\Accessibility.dll'
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Grace\documents\visual studio 2012\Projects\NaoLeap\NaoLeap\bin\Debug\LeapCSharp.NET4.0.dll'
A first chance exception of type 'System.BadImageFormatException' occurred in LeapCSharp.NET4.0.dll
An unhandled exception of type 'System.BadImageFormatException' occurred in LeapCSharp.NET4.0.dll
Additional information: Could not load file or assembly 'naoqi-dotnet4, Version=1.14.0.218, Culture=neutral, PublicKeyToken=b9b4e24bd78100d6' or one of its dependencies. An attempt was made to load a program with an incorrect format.
'NaoLeap.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'
The program '[3484] NaoLeap.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
The program '[3484] NaoLeap.vshost.exe: Program Trace' has exited with code 0 (0x0).
fuslogvw を使ってみました。プログラムがクラッシュした後に fuslogvw が更新されたときに失敗したアセンブリの 2 つのログ レポートを次に示します。
1)
<meta http-equiv="Content-Type" content="charset=unicode-1-1-utf-8"><!-- saved from url=(0015)assemblybinder: --><html><pre>
*** Assembly Binder Log Entry (2/1/2013 @ 7:24:49 PM) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Users\Grace\Documents\Visual Studio 2012\Projects\NaoLeap\NaoLeap\bin\Debug\NaoLeap.vshost.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = Grace-PC\Grace
LOG: DisplayName = Accessibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Users/Grace/documents/visual studio 2012/Projects/NaoLeap/NaoLeap/bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NaoLeap.vshost.exe
Calling assembly : System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
===
LOG: Start validating all the dependencies.
LOG: [Level 1]Start validating native image dependency mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
WRN: No matching native image found.
</pre></html>
2)
<meta http-equiv="Content-Type" content="charset=unicode-1-1-utf-8"><!-- saved from url=(0015)assemblybinder: --><html><pre>
*** Assembly Binder Log Entry (2/1/2013 @ 7:24:50 PM) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Users\Grace\Documents\Visual Studio 2012\Projects\NaoLeap\NaoLeap\bin\Debug\NaoLeap.vshost.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = Grace-PC\Grace
LOG: Where-ref bind. Location = C:\Users\Grace\Documents\Visual Studio 2012\Projects\NaoLeap\NaoLeap\bin\Debug\NaoLeap.exe
LOG: Appbase = file:///C:/Users/Grace/documents/visual studio 2012/Projects/NaoLeap/NaoLeap/bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NaoLeap.vshost.exe
Calling assembly : (Unknown).
===
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
</pre></html>