0

我一直在开发一款游戏,每次更新后我都会给我的朋友发送一个 setup.exe 来使用我用 Inno Setup 制作的。到目前为止,它一直运行良好。他能够安装游戏,但是当他运行 .exe 时,他得到“游戏已停止工作”。虽然安装后对我来说效果很好。我唯一能想到的可能是我使用存储容器添加了保存和加载。我选择保存位置:

 asyncResult = StorageDevice.BeginShowSelector(playerIndex, null, null);

 storageDevice = StorageDevice.EndShowSelector(asyncResult);

 asyncResult = storageDevice.BeginOpenContainer("Game1StorageContainer", null, null);

这会将文件放置在:Desktop\Libraries\Documents\SavedGames\Game\Game1StorageContainer\Player1\

这是一个模糊的问题,但也许有人有想法?

:: 更新 ::

好的,我让我的朋友重新安装了 XNA Runtime,同样的问题。

即使显示了隐藏文件夹,他的 minidump 文件夹中也没有文件。

但是我在这里有一个 Windows 错误日志:

 Application: My Game.exe
 Framework Version: v4.0.30319
 Description: The process was terminated due to an unhandled exception.
 Exception Info:Microsoft.Xna.Framework.GamerServices.GamerServicesNotAvailableException
 Stack:
    at Microsoft.Xna.Framework.GamerServices.KernelMethods+ProxyProcess..ctor(Microsoft.Xna.Framework.GamerServices.UserPacketBuffer)
    at Microsoft.Xna.Framework.GamerServices.KernelMethods.Initialize(Microsoft.Xna.Framework.GamerServices.UserPacketBuffer)
    at Microsoft.Xna.Framework.GamerServices.GamerServicesDispatcher.Initialize(System.IServiceProvider)
    at Microsoft.Xna.Framework.GamerServices.GamerServicesComponent.Initialize()
    at Microsoft.Xna.Framework.Game.Initialize()
    at My_Game.Game1.Initialize()
    at Microsoft.Xna.Framework.Game.RunGame(Boolean)
    at Microsoft.Xna.Framework.Game.Run()
    at My_Game.Program.Main(System.String[])

因此,它在 Game1.Initialize(); 处崩溃,其中包含:

 protected override void Initialize()
    {
        this.graphics.PreferredBackBufferWidth = 800;
        this.graphics.PreferredBackBufferHeight = 600;
        this.graphics.IsFullScreen = false;
        this.graphics.ApplyChanges();

        base.Initialize();
    }

所以肯定是 base.Initialize();,我猜这是因为我从框架中包含了一些新的库。所以我不知道该怎么做,我以前的游戏版本对他来说很好。

有人知道我能做什么吗?

谢谢

4

1 回答 1

1
  1. 他是否安装了XNA Runtime
  2. 检查 Windows 事件日志,它应该有崩溃的详细条目
  3. 当应用程序崩溃时,会创建一个小型转储。您应该能够将其加载到 Visual Studio 中并查看它崩溃的位置。
于 2012-07-30T16:03:19.050 回答