私はこのコードを持っています:
public UnnamedGame()
{
Exit();
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
無名ゲームは、ゲームの派生クラス (すべての XNA ゲームの基本クラス) です。Exit(); を呼び出すと、グラフィックの後の行にブレークポイントを設定すると、その行に到達しますが、これは発生すべきではありません。
また、いくつかのテストを行い、新しい XNA ゲームを作成しました。機能を変更する可能性のある追加のコードを追加せずに終了しようとすると、完全に動作します。
これはメインプログラムのコードです:
namespace UnnamedGame
{
#if WINDOWS || XBOX
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main(string[] args)
{
using (UnnamedGame game = new UnnamedGame())
{
game.Run();
}
}
}
#endif
}