Failed to load d3dx9_31.dll

Started by
11 comments, last by Dranith 17 years ago
Hi! I'm currently creating a game with Game Studio Express and XNA Framework. On some peoples machine they get the following error: System.TypeInitializationException: The type initializer for 'Microsoft.Xna.Framework.Graphics.GraphicsAdapter' threw an exception. ---> System.IO.FileNotFoundException: Failed to load d3dx9_31.dll. Please verify that you have the XNA Framework installed. at Microsoft.Xna.Framework.Graphics.GraphicsAdapter.InitalizeGraphics() at Microsoft.Xna.Framework.Graphics.GraphicsAdapter..cctor() If they then download the DirectX 9 runtime again (from webinstaller) it works. Why? They all already had DirectX 9.0c and XNA Framework installed. I'm not using any of my own shaders (only using BasicEffect). Why do they have to update DirectX? If you want to try the game please mail me. Read more about my game at http://shmup.blogspot.com Thanks in advance!
Advertisement
d3dx9_*.dll are the D3DX runtimes. There's a new version of the DLL for each new version of the SDK released.

Basically, you need to package the DirectX redistributable with your app as well, so people can get the correct DLL version.
It's strange, because I dont have DirectX SDK installed (I only have Game Studio Express).

When I build my game with Game Studio Express, is it building with the DirectX version I currently have on my computer? Shouldn't it use the "default" dll's Microsoft is using with Game Studio Express?

I'm confused here...
Hmm, could it have something to do with that I'm building the game on my Windows Vista machine?
Evil Steve is correct, have them download and install the most current version of DX. Game Studio Express comes with the needed libraries, since under XNA is DirectX (iirc), which is why it works for you (unless of course you manually updated, or installed a game that did).
But people that had Game Studio Express installed had the same problem. Started to work after they upgraded DirectX.
You may also have had a game silently install a recent DirectX on your system. (Microsoft has been recommending this to developers, and I know for a fact at least one popular game does it. ;)
Orin Tresnjak | Graphics ProgrammerBethesda Game StudiosStandard Disclaimer: My posts represent my opinions and not those of Bethesda/Zenimax, etc.
When I'm building my game (compiling) does it use the current version of DirectX I have on that machine (even if it's not the DirectX SDK, just the runtime)??
No, it uses whatever version of the DirectX libraries XNA game studio comes with. The DirectX runtimes on your computer have nothing to do with actually building the game. I've not used XNA game studio, but it has to come with some form of the DirectX libraries (that also come in the SDK) since:

from http://msdn2.microsoft.com/en-us/directx/aa937793.aspx

Q: Is the XNA Framework different from Managed DirectX (MDX)?
A: Yes. The XNA Framework is a completely different set of technologies targeted at game developers. It does share similarities based on the fact that the underlying technologies are still based on DirectX.

Get them to update themselves (as it would be a good idea anyways), or package the newest DirectX redist with your game.
When you build your game, it will (by default) compile against the latest version of the SDK you have installed. (Unless of course you install a new one and don't update the project, but that's another matter.)

It sounds like you have a later version of the XNA framework, which your game was compiled against, and expects to have running. Contrary to popular misconception, DX9.0c is not the latest version of DirectX - there are many smaller updates, mainly involving the d3dx9_*.dll files. If you compiled against version _31, and your users only had, say, _30 installed, you'll get the behaviour you described.

Note that XNA is similar to the DX SDK in that it includes multiple versions of various DLLs; XNA is, in a manner of speaking, a DX SDK - it isn't the C++ SDK, but it's still an SDK that depends on DirectX, and has version updates of its own.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

This topic is closed to new replies.

Advertisement