Sign in to follow this  

Failed to load d3dx9_31.dll

This topic is 3931 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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. ;)

Share this post


Link to post
Share on other sites
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)??

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Now that I think about it, I did upgrade Game Studio Express (for making it run with vista). Maybe Microsoft also upgraded it to compile against the new dll's?

That doesn't sound very good.

Share this post


Link to post
Share on other sites
Yeah, shame on them for updating DirectX. =P

Anyways, a new update to the DirectX SDK was released this month, so your updated version of XNA Game Studio is probably using that (yes, I know you aren't directly using the DirectX SDK). Although, I believe that update uses d3dx9_32.dll?

It seems that XNA game studio even comes with the redist you would need, in:

Microsoft XNA\XNA Game Studio Express\v1.0\Redist\DX Redist

In that folder (in my install at least) is an OCT2006_d3dx9_31_x86.cab. So, maybe your friends installed something incorrectly, and if they ran DXSTEUP.exe in that folder should give them the needed dll.

Share this post


Link to post
Share on other sites

This topic is 3931 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this