1

我正在通过 Visual Studio 执行 Xenko,这会打开 Xenko 的加载界面,选择我的项目后,它会打开 Xenko 的主界面。

问题开始了:当我窥探 Xenko 主界面的窗口时,它会停止代码的执行(确切地说,当我在窥探中按下左侧的 + 时它会停止)

见:https ://drive.google.com/open?id=1mYp1whk63DbAxLX4kSDOvBLUScS2h-c0

抛出 FatalExecutionEngineError 见:https ://drive.google.com/open?id=1ZcqNxawpoKh69ybD1ooSrbcnZ9zO-kwF

或者System.ExecutionEngineException当我尝试在 Visual Studio 中单击继续时。

如果它可以提供帮助,我们可以通过打开异常参数看到:
参见:https ://drive.google.com/open?id=1fuGeDvF-PO0uOvN07mStTUJHVDe_6BeB

有没有办法避免错误停止项目运行?怎么做?

我试过了:

  • 试着抓
  • 取消选中:发生该类型错误时停止
  • 检查它,但也检查“当它发生时除外......”
  • 禁用异常助手
  • 我也尝试直接启动 Xenko,而不是通过 Visual Studio 启动它,但它也明显崩溃了。
[STAThread]
public static void Main() {
    AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
    EditorPath.EditorTitle = XenkoGameStudio.EditorName;

    if (IntPtr.Size == 4) {
        MessageBox.Show("Xenko GameStudio requires a 64bit OS to run.", "Xenko", MessageBoxButton.OK, MessageBoxImage.Error);
        Environment.Exit(1);
    }

    PrivacyPolicyHelper.RestartApplication = RestartApplication;
    PrivacyPolicyHelper.EnsurePrivacyPolicyXenko30();

    // We use MRU of the current version only when we're trying to reload last session.
    var mru = new MostRecentlyUsedFileCollection(InternalSettings.LoadProfileCopy, InternalSettings.MostRecentlyUsedSessions, InternalSettings.WriteFile);
    mru.LoadFromSettings();

    EditorSettings.Initialize();
    Thread.CurrentThread.Name = "Main thread";

    // Install Metrics for the editor
    using(XenkoGameStudio.MetricsClient = new MetricsClient(CommonApps.XenkoEditorAppId)) {
        try {
            // Environment.GetCommandLineArgs correctly process arguments regarding the presence of '\' and '"'
            var args = Environment.GetCommandLineArgs().Skip(1).ToList();
            var startupSessionPath = XenkoEditorSettings.StartupSession.GetValue();
            var lastSessionPath = EditorSettings.ReloadLastSession.GetValue() ? mru.MostRecentlyUsedFiles.FirstOrDefault() : null;
            var initialSessionPath = !UPath.IsNullOrEmpty(startupSessionPath) ? startupSessionPath: lastSessionPath ? .FilePath;

            // Handle arguments
            for (var i = 0; i < args.Count; i++) {
                if (args[i] == "/LauncherWindowHandle") {
                    windowHandle = new IntPtr(long.Parse(args[++i]));
                }
                else if (args[i] == "/NewProject") {
                    initialSessionPath = null;
                }
                else if (args[i] == "/DebugEditorGraphics") {
                    EmbeddedGame.DebugMode = true;
                }
                else if (args[i] == "/RenderDoc") {
                    // TODO: RenderDoc is not working here (when not in debug)
                    GameStudioPreviewService.DisablePreview = true;
                    renderDocManager = new RenderDocManager();
                }
                else if (args[i] == "/Reattach") {
                    var debuggerProcessId = int.Parse(args[++i]);

                    if (!System.Diagnostics.Debugger.IsAttached) {
                        using(var debugger = VisualStudioDebugger.GetByProcess(debuggerProcessId)) {
                            debugger ? .Attach();
                        }
                    }
                }
                else if (args[i] == "/RecordEffects") {
                    GameStudioBuilderService.GlobalEffectLogPath = args[++i];
                }
                else {
                    initialSessionPath = args[i];
                }
            }
            RuntimeHelpers.RunModuleConstructor(typeof(Asset).Module.ModuleHandle);

            //listen to logger for crash report
            GlobalLogger.GlobalMessageLogged += GlobalLoggerOnGlobalMessageLogged;

            mainDispatcher = Dispatcher.CurrentDispatcher;
            mainDispatcher.InvokeAsync(() = >Startup(initialSessionPath));

            using(new WindowManager(mainDispatcher)) {
                app = new App {
                    ShutdownMode = ShutdownMode.OnExplicitShutdown
                };
                app.Activated += (sender, eventArgs) = >{
                    XenkoGameStudio.MetricsClient ? .SetActiveState(true);
                };
                app.Deactivated += (sender, eventArgs) = >{
                    XenkoGameStudio.MetricsClient ? .SetActiveState(false);
                };

                app.InitializeComponent();
                app.Run();
            }

            renderDocManager ? .Shutdown();
        }
        catch(Exception e) {
            HandleException(e, 0);
        }
    }
}

我不能给你任何可以重现错误的东西,但至少你可以看到错误的上下文。它停在app.Run();

如果我在 snoop 中展开树时项目可以继续运行,那就太好了,因为当然当项目停止运行时 snoop 也会关闭。

4

0 回答 0