我想在VS2017 C#中使用directx3d.dll [英] I want to use directx3d.dll in VS2017 C#
问题描述
我尝试编写Triangle代码,但不接受DirectX3d.dll。我收到此错误消息:
System.BadImageFormatException:'无法加载文件或程序集'Microsoft.DirectX.Direct3D.dll'或其依赖项之一。不是有效的Win32应用程序。 (来自HRESULT的异常:0x800700C1)'
我知道我使用的dll是旧的,但我使用的是DirectX.dll,它来自3d来自同一组。
我尝试了什么:
我试图从net 2开始使用不同的净值最高4.6.1。当它使用较低的净级别时,我得到其他错误,所以我停在4.1
I tried to program that Triangle code but it won't accept DirectX3d.dll. I get this error message:
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)'
I know that the dll I am using is old but I am using DirectX.dll and it is from the same group that 3d came from.
What I have tried:
I tried to use different net levels starting from net 2 on up to the highest 4.6.1. When it uses lower net levels I get other errors so I stop at 4.1
推荐答案
转到项目属性,构建选项卡,并将平台目标从AnyCPU更改为x86 。
重建您的应用程序,您不应再出现该错误。
Go to your Project Properties, Build tab, and change the Platform Target from AnyCPU to x86.
Rebuild your app and you shouldn't get that error anymore.
这篇关于我想在VS2017 C#中使用directx3d.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!