- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
目前,我遇到了一个问题,我无法通过 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 时失败程序集的两个日志报告。
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>
最佳答案
Could not load file or assembly 'naoqi-dotnet4
来自vendor's documentation很明显,NAO 包含 native C++ 代码,并且必须针对 x86(32 位代码)构建它。但是,您正在以 64 位模式运行主 EXE。结果是 BadImageFormatException,64 位进程无法加载包含 32 位 native 代码的程序集。
右键单击您的 EXE 项目、“属性”、“生成”选项卡。将平台目标更改为“x86”。
关于c# - NaoQi 和 Leap 问题 : An unhandled exception of type 'System.BadImageFormatException' . .. 并且无法加载文件或程序集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14657361/
我有一个 Web 服务,每当我尝试从 Visual Studio 运行该服务时,它都会引发 BadImageFormatException。 This answer另一个问题建议对 DLL 运行 pe
我在 X64 上运行 这是我的代码: ColorFileMapping = CreateFileMapping(new IntPtr(-1), IntPtr.Zero, 0x04, 0, _byte
在 Windows 8 64 位上编译或尝试运行我的应用程序时抛出“BadImageFormatException”。我在网上搜索了一下,很多人都有同样的错误信息。但是,没有一个解决方案可以解决我的问
尝试使用 C# 7 的局部函数,我最终得到了一些有趣的行为。考虑以下程序: public void Main() { Console.WriteLine("Entered Main");
这个问题在这里已经有了答案: Could not load file or assembly ... An attempt was made to load a program with an in
我有一个使用 Visual Studio 2010 并以完整的 .NET Framework 4 为目标用 C# 编写的 Windows 服务。当我从调试版本运行时,该服务按预期运行。但是,当我从发布
我正在为另一个基于公共(public) .NET API 的程序编写插件。通常,这些插件是通过创建引用 API 程序集的类库 DLL 来制作的。然后通过从 API 程序集中的基本命令类继承来创建命令类
在通过联系本地 Web 服务的 .NET 3.5 SP1 项目进行调试时,我收到了异常 System.BadImageFormatException:“错误的类标记” 当然,关于导致异常的原因没有更多
我正在开发我的第一个自定义操作,但无法加载生成的 .CA.dll 文件。这是最简单的过程和结果: 我创建了一个自定义操作项目并保留所有默认值。该类看起来像这样: using Microsoft.Dep
我正在尝试运行我在 Visual Studio 2012 中创建的 WCF 服务。 我在页面中遇到以下错误。 > Exception Details: System.BadImageFormatExc
后续行动: OpenGL4Net WM_PAINT does not exist? 我仍然密切关注:https://sourceforge.net/p/ogl4net/wiki/Tutorials 目
我正在尝试运行我在 Visual Studio 2012 中创建的 WCF 服务。 我在页面中遇到以下错误。 > Exception Details: System.BadImageFormatExc
我已经从 Here 下载了 tesseract。当我尝试将 dll 文件添加到 visual studio 2012 时,它显示错误,表明它不是有效的程序集。任何人都可以建议我一些其他的 ocr 和示
请帮忙,我已经尝试了所有我能想到的方法来解决这个问题。 在您回复之前请注意: 我已尽我所能解决 StackOverflow.com 上的其他问题和网络上的其他软件。例如但不限于:将构建配置从“任何 C
我发誓 Microsoft 对 Visual Studio 的“进化”越多,整个过程就越无知。 我有一个包含 3 个类库的 Windows 服务。我进入每个类库的属性并将平台目标设置为 x64。我对
我遇到以下运行时错误,我的控制台应用程序 (VS2012) 引用“dcasdk.dll”。控制台应用程序的 .Net Framework 是 4.5,平台目标是“任何 CPU”。 Could not
当我尝试运行安装程序来设置服务时出现以下异常: # ./InstallUtil ../../../../Applications/GasPosApp/bin/Wrapper.exe -s ../../
当我尝试在 IIS 7.0(在 Windows Server 2008 上使用 VSTS 2010 + .Net 4.0 开发)中访问网站中的页面 (default.aspx) 时,我遇到了以下错误消
尝试从 .net 连接到 oracle 数据库时出现以下异常: Attempt to load Oracle client libraries threw BadImageFormatExceptio
问题 我正在构建服务结构应用程序。当我创建一个项目并运行它时,它工作正常。但是当我在 Api Controller 中注入(inject)服务时,它给了我这个错误,我尝试解决它但尚未成功。 错误 Sy
我是一名优秀的程序员,十分优秀!