How do I get an XNA 4.0 game to run on other machines?
Question
Whenever I try and run a game made in XNA 4.0 on a machine other than ones used for development, it just won't run. I've followed the instructions here to ensure that all the dependencies are present.
To be clear I've done the following:
Downloaded and installed the Microsoft .NET Framework 4 Client Profile.
Downloaded and installed the Microsoft XNA Framework Redistributable 4.0.
- Made sure I am not using anything contained within
GamerServices
andMicrosoft.Xna.Net.*
, my references are as follows:
Microsoft.Xna.Framework
Microsoft.Xna.Framework.Avatar
Microsoft.Xna.Framework.Game
Microsoft.Xna.Framework.Graphics
Microsoft.Xna.Framework.Storage
Microsoft.Xna.Framework.Video
Microsoft.Xna.Framework.Xact
mscorlib
System System.Core
System.Windows.Forms
System.Xml
System.Xml.Linq
I also followed the advice here to ensure the problem was not within the code itself.
I've tried the follow methods to get it to run (on both Vista and 7):
- Use the built in publishing functionality. This results in an error saying that
Microsoft.Xna.Input.Touch
needs to be present in the GAC. I've tried addingMicrosoft.Xna.Input.Touch
to the references, and this does not fix the issue. - Copy the XNA dll files locally. This results in an error message stating that
Microsoft.Xna.Game.dll or one of its dependencies could not be located
. - Copy over everything contained in
Release
. This results in anApplication X stopped working...
orAPPCRASH
error message the second it starts. My code is never reached.
Is there any way to get this to work? I've been attempting to fix it, and with the deadline looming it has been a source of unneeded stress.
Solution
It turns out the XNA Beta assemblies were still kicking around on the dev machine, and VS opted to use those instead of the correct assemblies for some reason.