ScriptedSandbox64.exe 打开 Word 加载项对话框时已停止工作

ScriptedSandbox64.exe has stopped working when opening word add-in dialog

我目前正在使用 Visual Studio 2017 Community Edition 制作 Word Web 插件(在 Windows Server 2016 Standard - with RDP 上开发)。

我需要向我的应用程序添加一个对话框 window,因为我的应用程序的一部分需要更多的屏幕空间。

所以我正在显示一个对话框,因为它已在此处进行了解释: https://dev.office.com/docs/add-ins/develop/dialog-api-in-office-add-ins

Office.context.ui.displayDialogAsync(window.location.protocol + '//' + window.location.host + '/TestDialog.html'); 

TestDialog.html:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <title>Test Dialog</title>
    <script src="https://www.promisejs.org/polyfills/promise-7.0.4.min.js"></script>
    <script src="Scripts/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js" type="text/javascript"></script>

    <link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/2.1.0/fabric.min.css">
    <link rel="stylesheet" href="https://appsforoffice.microsoft.com/fabric/2.1.0/fabric.components.min.css">
</head>
<body>
    Test dialog
</body>
</html>

对话框成功弹出,但紧接着我收到 windows 错误 "ScriptedSandbox64.exe has stopped working"。此外,在那之后,当我执行任何代码来同步文档时,我得到错误:

GeneralException: An internal error occured

我想这是崩溃造成的 ScriptedSandbox.exe。 当我做一个异常的console.log(),并尝试在VisualStudio中查看异常信息时,我也得到了ScriptedSandbox.exe错误。

我尝试了这个 Whosebug 问题的解决方案,但这对我的情况确实有帮助:

在 windows 事件日志中,我看到以下内容:

Fault bucket , type 0 Event Name: VisualStudioNonFatalErrors2 Response: Not available Cab Id: 0 Problem signature: P1: ScriptedSandbox64.exe P2: 15.0.26228.9 D15RTWSVC P3: VS/ScriptedHost/Dom Version:1.0 P4: Title:Dom Version:1.0 Domain: microsoft.com P5: 15.0.26228.0 P6: 58b562f7 P7: res://c:\program files (x86)\microsoft visual studio17\community\common7\ide\commonextensions\microsoft\webclient\diagnostics\toolwindows\vsresources.dll/#23/console/ConsoleMerged.js P8: 5938 P9: Target already added: uid0 P10: ScriptedPluginHost Attached files: \?\C:\Users\ADMINI~1\AppData\Local\Temp\SPE9F38.tmp These files may be available here: Analysis symbol: Rechecking for solution: 0 Report Id: 66676cbf-1228-11e7-85c1-d8d385e237a2 Report Status: 262144 Hashed bucket:

Fault bucket 127830074891, type 5 Event Name: VisualStudioNonFatalErrors2 Response: Not available Cab Id: 0 Problem signature: P1: ScriptedSandbox64.exe P2: 15.0.26228.9 D15RTWSVC P3: VS/ScriptedHost/Dom Version:1.0 P4: Title:Dom Version:1.0 Domain:microsoft.com P5: 15.0.26228.0 P6: 58b562f7 P7: res://c:\program files (x86)\microsoft visual studio17\community\common7\ide\commonextensions\microsoft\webclient\diagnostics\toolwindows\vsresources.dll/#23/console/ConsoleMerged.js P8: 3632 P9: Unable to get property 'channel' of undefined or null reference P10: ScriptedPluginHost Attached files: \?\C:\Users\ADMINI~1\AppData\Local\Temp\SPE862B.tmp \?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER86C1.tmp.WERInternalMetadata.xml These files may be available here: C:\ProgramData\Microsoft\Windows\WER\ReportArchive\Critical_ScriptedSandbox6_f7aa31cc56162be295698083cac29769faeb4a7_00000000_17ac8f0e Analysis symbol: Rechecking for solution: 0 Report Id: b0b5bb75-1228-11e7-85c1-d8d385e237a2 Report Status: 1 Hashed bucket: 558ba9ae3c60bfdc002e0f1b9732736d

有没有人知道问题可能是什么,或者我该如何解决?

正如我所怀疑的,这确实是两个不同的问题。

似乎无法从加载项对话框中同步到文档。为了解决这个问题,我现在使用以下代码将信息传回主用户界面:

    Office.context.ui.messageParent(JSON.stringify({
        type: 'myCustomType',
        data: myData
    }))

另一个问题,消息 "ScriptedSandbox64.exe has stopped working",它只在您使用 Visual Studio 时出现,而不是在已发布的版本中。我现在就点击它。