Game using .NET 2.0 and DX9 doesn't run

Started by
4 comments, last by cwc 16 years, 11 months ago
First post! If this topic doesn't quite fit this forum, I apologize. :D So I'm new to programming with DirectX, and this is my first app. It's just a really simple C# DirectDraw app that draws some sprites bouncing around the window. Naturally, it runs fine on my dev machine, but I haven't been able to get it to run on my test computer. Immediately upon launching the program, an unhandled exception is encountered (System.Io.FileNotFoundException). I initially assumed it wasn't finding the audio and image files (one of each) that are loaded, so I wrote appropriate error-handling to catch the exception, show a MessageBox, and continue gracefully. Yet the error persists. All I can think of at this point is that some key library is missing on the test pc. I've double-checked that .NET 2.0 is installed (and I'm specifically building for 2.0 in SharpDevelop) as well as DirectX 9.0c. Anyone have any ideas?
Advertisement
Is managed directx installed? Are the directx runtimes that it depends on installed? (You haven't specifically said you're using mdx, but I'm assuming you are).

Remember that there's many different versions of the direct3dx library. The one that your version of mdx uses may not be installed. You need to figure out which of the redistributables that come with your SDK you need, and install them on the test machine.

Just having directx installed doesn't ensure that this other stuff is installed. You need to include a redistributable with your app.

edit- any time you ask about an error, you should post the COMPLETE error, copy and paste it right from the IDE. There should be more info than just the name of the exception.
Quote:Original post by gharen2
Is managed directx installed? Are the directx runtimes that it depends on installed? (You haven't specifically said you're using mdx, but I'm assuming you are).

Remember that there's many different versions of the direct3dx library. The one that your version of mdx uses may not be installed. You need to figure out which of the redistributables that come with your SDK you need, and install them on the test machine.

Just having directx installed doesn't ensure that this other stuff is installed. You need to include a redistributable with your app.


Your assumption was correct; sorry for leaving that part out. As this is both my first C# and first DirectX app, I assumed just installing DX9 + the .NET framework on the target computer would satisfy the requirements.

Quote:Original post by gharen2
edit- any time you ask about an error, you should post the COMPLETE error, copy and paste it right from the IDE. There should be more info than just the name of the exception.


I will remember this in the future; just to clarify, however, the error is not occurring within the IDE. I built a release EXE (no debugging symbols) and copied it, along with the image and sound files it references, to the test pc.

The error message is the standard "Program.exe has encountered a problem and needs to close.", Send/Don't Send Error Report, etc. dialog. Upon clicking "What data does this error report contain?", I saw the name of the exception.

I will attempt to find the package you're referring to for MDX. Offhand I don't recall how the SDK I'm using was referred to exactly, but I think MS' website just called it the 'DirectX 9 SDK'.
And shortly after my reply, I found this helpful link:

http://nexe.gamedev.net/directknowledge/default.asp?p=Distributing%20DirectX%20applications

I am not sure why I couldn't find this simple article prior to my original posting. And it's part of GD.net at that! :D

Now, as I understand it, it takes three packages to distribute a managed DX app, and apparently four if using D3D.
Good that the problem was found. Welcome to the joys of c# and mdx. Although you do encounter annoying problems like this, they two are a joy to use in comparison to c++ and native directx. SO much cleaner and easier.

The redistributables you need should be installed in the SDK on your development machine.

On my computer it's at C:\Program Files\Microsoft DirectX SDK (February 2007)\Redist.
Thanks for all your help. And yes I do feel like I dodged a bullet in waiting this long to get into DirectX. One look at some C++ DirectX code was one too many. :D

My test pc is actually my pc at work. I attempted to install the MDX runtimes by using this package:

http://www.microsoft.com/downloads/details.aspx?familyid=d2e2cae1-6aef-4a40-bd00-f0fb2a71e99f&displaylang=en

It's the April 2007 package, which seems to include all previous cab files (and I only downloaded the DX9 SDK like a week or two ago, so I figured I would be covered). Extracting and running DXSetup seemed to install all the included packages, but my program still doesn't run.

I may just have to wait until I get home and copy the runtime from the SDK folder as you suggested, for testing next week.

This topic is closed to new replies.

Advertisement