How do I get an XNA 4.0 game to run on other machines?

◇◆丶佛笑我妖孽 提交于 2019-12-13 05:27:01

问题


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:

  1. Downloaded and installed the Microsoft .NET Framework 4 Client Profile.

  2. Downloaded and installed the Microsoft XNA Framework Redistributable 4.0.

  3. Made sure I am not using anything contained within GamerServices and Microsoft.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 adding Microsoft.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 an Application X stopped working... or APPCRASH 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.


回答1:


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.



来源:https://stackoverflow.com/questions/4434191/how-do-i-get-an-xna-4-0-game-to-run-on-other-machines

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!