C# & XNA Running Games on other PC's [Solved]

Started by
6 comments, last by Emmanuel Deloget 17 years, 2 months ago
Okay, this is really starting to annoy me. I've searched everywhere but have yet to find a solution to the problem. I am using XNA GSE version 1 with C#. I have written several demos, each of which compiles and runs on my PC through GSE (ie. Start Debugging). When, however, I go through my Start Menu->My Documents->etc.->Release->MyGame.exe, it conks out with a "Send Error Report" thingy. The details: Error Type: clr20r3 Error In: microsoft.xna.framework.game, mscorlib Error: system.io.filenotfoundexception However, if I bring up Windows Explorer and navigate to the file, then dbl-click it, voila! it works perfectly fine. :S This is just a funny phenomenon I've noticed. Now, my real problem. When I build to Release my game, I now have a bunch of files. I copy these files to my USB-key, take them to my other PC's and try to run it. It doesn't work. This time, however, the details are: Error Type: clr20r3 Error In: microsoft.xna.framework.game, mscorlib Error: system.typeinitilization My PC (first error) has VC# 2005 Express, .NET Framework 2.0 & 3.0, XNA Framework, latest DirectX, hardware requirements etc. The other PC's (second error) are exactly the same EXCEPT they do not have VC# installed. All have the latest drivers also. Can someone please help me? What's the point of writing games if I can't show them off? :D [Edited by - RandyJohn on January 31, 2007 3:19:41 AM]
"You are a God amongst insects. Never let anyone tell you any different..."
Advertisement
Quote:Original post by RandyJohn
Okay, this is really starting to annoy me. I've searched everywhere but have yet to find a solution to the problem.

I am using XNA GSE version 1 with C#. I have written several demos, each of which compiles and runs on my PC through GSE (ie. Start Debugging). When, however, I go through my Start Menu->My Documents->etc.->Release->MyGame.exe, it conks out with a "Send Error Report" thingy. The details:

Error Type: clr20r3
Error In: microsoft.xna.framework.game, mscorlib
Error: system.io.filenotfoundexception

However, if I bring up Windows Explorer and navigate to the file, then dbl-click it, voila! it works perfectly fine. :S This is just a funny phenomenon I've noticed.

This is not funky. This is a shortcut problem. You are not executing the program in the directory where you stored the program and as a result, it fails to load a file it needs. You have to change the shortcut options.

Quote:Original post by RandyJohn
Now, my real problem. When I build to Release my game, I now have a bunch of files. I copy these files to my USB-key, take them to my other PC's and try to run it. It doesn't work. This time, however, the details are:

Error Type: clr20r3
Error In: microsoft.xna.framework.game, mscorlib
Error: system.typeinitilization

My PC (first error) has VC# 2005 Express, .NET Framework 2.0 & 3.0, XNA Framework, latest DirectX, hardware requirements etc. The other PC's (second error) are exactly the same EXCEPT they do not have VC# installed. All have the latest drivers also.

Can someone please help me? What's the point of writing games if I can't show them off? :D

To play your game on another PC, you must install the XNA redist on this PC. It is available as a download on MS XNA web site.


Regards,
Okay, thankyou for your explanation of the first problem, it wasn't really a problem as such I just did not quite understand what was happening.

As for my second problem, as I satated in my post ALL my computers have the XNA Framework installed (xnafx_redist.msi) downloaded from Microsoft.

Why does it not work??
"You are a God amongst insects. Never let anyone tell you any different..."
Well, with the system.typeinitilization error indicating that some type could not be found (or properly initialized), I'd still guess there's something wrong with the installed runtime components on your deployment machines. If you're sure you have the latest DirectX runtime installed and your XNA runtime matches the XNA version you developed on though, I wouldn't know what's causing this issue.

Try deploying an empty Windows game project to make sure the problem isn't with XNA. If the empty project fails to run and you're 100% positive you have all prerequisites installed on the deployment machine, you might want to send a bug report to MS through http://connect.microsoft.com.


And a little offtopic note:

Quote:Original post by Emmanuel Deloget
This is not funky. This is a shortcut problem. You are not executing the program in the directory where you stored the program and as a result, it fails to load a file it needs. You have to change the shortcut options.


Are you sure XNA behaves like this? It's pretty easy to fetch the path to the executable assembly, so I'd imagine the MS folks used that as the base path for the ContentManager. Perhaps the OP is loading resources outside the content pipeline?
Rim van Wersch [ MDXInfo ] [ XNAInfo ] [ YouTube ] - Do yourself a favor and bookmark this excellent free online D3D/shader book!
Also take note that there might be more DirectX versions than you expect.

There's about one new DirectX 9.0c each two or three months, XNA applications require the DirectX 9.0c December 2006 release because the XNA framework relies on D3DX9_32.dll which has only been added to the DirectX redistributables recently.

I've built an XNA game myself and tested it on various PCs: Ball Race.
If you follow the download link on that page, there are 3 URLs listed: the .NET Framework 2.0, DirectX 9.0c December 2006 and the XNA Redistributable. Those three are all that's needed for me (on a fresh windows install).

-Markus-
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
To remigius:

I tried compiling standard Windows Game and SpaceWars, both failed on the other PC's. I am still convinced that XNA is not the problem though, you might be right about the DirectX stuff though.

To Cygon:

Quick question (you might know) do all of the games made with XNA require Shader Model 2.0? I'm downloading and re-installing DirectX, no results so far, but this could be the problem.

Also, I've noticed that in my .NET Framework directory (C:\Windows\etc.) I have an mscorlib.xml which the other PC's don't have. I've tried copying this over to the others but it still doesn't work. Any idea what this is? I had a quick squiz it looks like Registry Keys. Anyway, if I get any results I'll re-post. Thanks so far guys.

[Edit]

It worked!! Thanks guys. The problem was that they did not have the aforementioned d3dx9_32.dll, although they had DirectX 9.0c they had an earlier version of this file. Thanks alot!!

[Edited by - RandyJohn on January 31, 2007 3:44:57 AM]
"You are a God amongst insects. Never let anyone tell you any different..."
Quote:Original post by RandyJohn
To Cygon:

Quick question (you might know) do all of the games made with XNA require Shader Model 2.0? I'm downloading and re-installing DirectX, no results so far, but this could be the problem.

Also, I've noticed that in my .NET Framework directory (C:\Windows\etc.) I have an mscorlib.xml which the other PC's don't have. I've tried copying this over to the others but it still doesn't work. Any idea what this is? I had a quick squiz it looks like Registry Keys. Anyway, if I get any results I'll re-post. Thanks so far guys.


XNA games require at least shader model 1.1 to be supported in hardware. Depending on the shaders you're using, you can up this requirement as far as shader model 3.0, but unless you've got insanely complex shaders, you should easily get away with shader model 1.1

Just FYI: mscorlib.xml is just the XML documentation for the classes in mscorlib.dll. It's most likely installed together with Visual C# Express and won't been needed at runtime :)

-Markus-
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
Quote:Original post by remigius
Quote:Original post by Emmanuel Deloget
This is not funky. This is a shortcut problem. You are not executing the program in the directory where you stored the program and as a result, it fails to load a file it needs. You have to change the shortcut options.


Are you sure XNA behaves like this? It's pretty easy to fetch the path to the executable assembly, so I'd imagine the MS folks used that as the base path for the ContentManager. Perhaps the OP is loading resources outside the content pipeline?


I don't know how XNA behave, it just see that this is a filenotfound exception and that the program doesn't generate this exception if ran from its directory. These are failry common symptoms [smile].

OTOH, I don't know why XNA would use the program directoty they extract from the program path. What if you want to use the software from another directory? (I admit this is a bit strange, but I often do stuff like that while debugging).

Regards,

This topic is closed to new replies.

Advertisement