Sign in to follow this  
DarkMark

[.net] My game works on no computer

Recommended Posts

DarkMark    122
Hi @all, I'm pretty new to game programming and just finished my first project with C# and DirectX. Now I have the problem that it runs on no computer but on mine. First it didn't find the .dlls, fine, I created a 'setup and deployment' project and had VS add all dependencies. But now the directx.direct3d.dll throws a NullReferenceException on any other computer but on mine. I have really no idea what the problem could be, and this error message doesn't help me at all since it does not tell where the error occurs. my configuration: VS.NET 2003, directx sdk dec. 2005, DirectX 9.0c Any idea what the problem could be or a where I can start searching?

Share this post


Link to post
Share on other sites
Mykre    405

You also need to make sure that the client machines are running the same version of directX as the one that the application was developed in. By version I do not mean the normal 9c, each time the DirectX SDK has been released there have been updates to the managed directX system. With these updates the versions on the assemblies change, to help with this MS releases a new runtime with each SDK Release. You need to make sure that the clients are using this runtime.

On another note MS has now released a WEB Installer that will install the latest as well as previous versions of the managed assemblies, you could configure you setup project to run this each install, or package up the new runtimes.

Share this post


Link to post
Share on other sites
Rob Loach    1504
If you debug the application and look at the Message and the InnerException of the NullReferenceException, it might lead you to what the problem is.
Quote:
Original post by BradSnobar
.net 2003 runs the 1.1 framework.
Make sure that you have that framework and not the 2.0 framework installed too.
The .NET 1.1 and 2.0 Frameworks were built to run beside each other. It is actually recommended you have both installed at the same time. If you're looking to develop in .NET 2.0, however, you're going to have to pick yourself up a copy of Visual Studio 2005, SharpDevelop 2.0 or another alternative.

Share this post


Link to post
Share on other sites
Krisc    494
A good thing to do is ship them a version that prints out all the data of the exception to a file and have them send that file to you. Or at the very minimum print out the stack trace in a message box.

Share this post


Link to post
Share on other sites
DarkMark    122
Thanks for the answers so far. I made a mistake in my first post: At first a System.IO.FileNotFound exception is thrown.
I still haven't figured out the problem, the machines I tested it all have the .Net framework 1.1 and DirectX 9.0c. But it might be another DirectX 9.0c version than I have though. But the latest one should work, shouldn't it?

I used the JIT debugger and it tells me that the file is Microsoft.DirectX.Direct3DX.dll or one of its dependencies. The mentioned .dll file was installed along with the application, might it be one of its dependencies? How can I find out which one?
I assume the installer registers the libraries correctly. Is that assumption too bold?

[Edited by - DarkMark on April 18, 2006 9:22:08 AM]

Share this post


Link to post
Share on other sites
This is a stab in the dark, but did you install DirectX with Managed Extensions on the machine? This has been a source of a lot of our nightmares on our senior project at school (9.0c installed, but not the managed extentions...bah!).

See this page for more info. It's an older page, but the first one I ran across when I went to look.

HTH

Edit: BTW, we got the FileIOException when we tried to run on the school machines, which is how we knew it wasn't there.

Share this post


Link to post
Share on other sites
thezbuffer    706
The link to 'DirectX with managed extensions' is horribly out of date.

To run MDX apps you need the .Net framework

.Net 1.1 installer

.Net 2.0 installer

Then run the DirectX Web installer on your target machine. You need to run the DirectX installer after you know .Net is on the machine or it won't install the managed directx parts.

If the app still doesn't run after this then its probably looking for one of your own data files. Use FileMon from http://www.sysinternals.com to find out what else is missing.

Share this post


Link to post
Share on other sites
DarkMark    122
It is finally working :)

I think it was the problem with the Managed DirectX stuff, after installing the whole 46MB DirectX End-User Runtimes (December 2005) it worked. The web installer might be working, too, I have to try that one.

Still I think that is a stupid concept, when I want someone else to play my game he first has to download and install .Net, then download and install the DirectX Runtimes... not many people are going to play this game. I'd prefer it if my installer would work. Well, nevermind.

Thanks @all for your help!

Share this post


Link to post
Share on other sites
thezbuffer    706
You wrote a game using Managed DirectX. So guess what! It needs the .Net runtime and the correct parts of the DirectX SDK. Just like any .Net program needs .Net and any 3rd party components you chose to use. What do you think your installer would be able to do that doesn't include those 2 things.

If you would prefer to write an installer then it perfectly possible to link both the .Net installer and the DirectX installer into your program. For the .Net part you can use click once which wil automatically install .Net if its missing. For the DirectX part its fully documented in the SDK help file. It even tells you how to reduce the size of your installer as much as possible.

In reality its best to just direct your users to the web installer. Its a very small download that looks at the computer and only downloads the missing components. So the best case is that it runs very quickly.

At the end of the day you can't avoid everything - even if you use native DirectX and C++ there is a C++ runtime (though its far smaller than .Net) and you still need the core DirectX files. If you use any of the D3DX stuff then you still need to use the DirectX setup program in your installer.

Share this post


Link to post
Share on other sites
Calin    419
Quote:
Original post by thezbuffer
The link to 'DirectX with managed extensions' is horribly out of date.

To run MDX apps you need the .Net framework

.Net 1.1 installer

.Net 2.0 installer

Then run the DirectX Web installer on your target machine. You need to run the DirectX installer after you know .Net is on the machine or it won't install the managed directx parts.

If the app still doesn't run after this then its probably looking for one of your own data files. Use FileMon from http://www.sysinternals.com to find out what else is missing.


Very useful. I think this post should be placed in the ForumFAQ, which is empty anyway. It'll save a lot of questions.

[Edited by - Calin on April 21, 2006 5:24:46 PM]

Share this post


Link to post
Share on other sites

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