c# - 使用 MDX 时缺少 Direct3D.dll 依赖项

标签 c# directx mdx managed-directx

我在 Windows 2008R2(安装了所有 DX 驱动程序)上使用了一段完美运行的 MDX 代码,但出现了以下相当奇怪的错误。知道这意味着什么吗?

System.BadImageFormatException: Could not load file or assembly 'Microsoft.DirectX.Direct3D.dll' or one of its dependencies.  is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
File name: 'Microsoft.DirectX.Direct3D.dll'
   at Nesteruk.MdxConsole.Console..ctor(Boolean fullScreen, Int32 charWidth, Int32 charHeight, Int32 windowWidth, Int32 windowHeight)
   at Nesteruk.MdxConsole.Console..ctor(Viewport viewport) in c:\Users\Dmitri.EUPHORIA\Projects\Open-Source\MdxConsole\MdxConsole\Console.cs:line 67
   at Nesteruk.MdxConsole.Console.NewConsole(Int32 width, Int32 height) in c:\Users\Dmitri.EUPHORIA\Projects\Open-Source\MdxConsole\MdxConsole\Console.cs:line 471
   at MdxConsoleDemo.Program.Everything() in c:\Users\Dmitri.EUPHORIA\Projects\Open-Source\MdxConsole\MdxConsoleDemo\Program.cs:line 51
   at MdxConsoleDemo.Program.Main() in c:\Users\Dmitri.EUPHORIA\Projects\Open-Source\MdxConsole\MdxConsoleDemo\Program.cs:line 30

最佳答案

您的操作系统是 64 位的吗?如果是,请在 Project Properties -> Build 选项卡中将 Platform Target 设置为 x86。 MDX 仅为 32 位,尝试将其加载到 64 位进程会导致 BadImageFormatException

关于c# - 使用 MDX 时缺少 Direct3D.dll 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2976914/

相关文章:

winapi - 如何使用DirectWrite在面向脚本的OpenType功能与其他OpenType功能之间取得平衡?

c++ - 如何从 IDWriteFontFace 创建 IDWriteTextFormat

sql - 如何找到长时间运行的查询?

ssas - 非空先前值 - MDX

c# - 是否有可能覆盖默认的 FluentAsserions 消息?

c# - 仅获取更新查询的结果

C# .Net Socket 保持事件时间?

c# - 接口(interface)函数 C#

c++ - 在 DirectX 10/11 中使用无符号字节纹理

mdx - 在 MDX 中添加复杂度量