【问题标题】:ECONNREFUSED 127.0.0.1:9222 when trying to run Microsoft Office Add-In Debugger尝试运行 Microsoft Office 加载项调试器时出现 ECONNREFUSED 127.0.0.1:9222
【发布时间】:2021-12-23 17:14:05
【问题描述】:

在尝试为 VS Code 的 Microsoft Office 加载项调试器扩展运行调试器时,单击“播放”按钮时出现此错误:

for Chrome 之前,我曾多次看到过这个问题,但没有专门针对 Microsoft Office 加载项。

我试过了:

  • 重启 VS Code 并重启我的机器
  • 运行netstat -an | find /i "listening" 以查看哪些端口正在我的机器上侦听,并尝试用这些端口中的每一个替换端口9222 以获得launch.json 中的"port"
  • 尝试将端口密钥更新为目标端口4200,(我的应用程序所在的端口,https://localhost:4200)
  • 验证 webRoot 是正确的路径。
  • 完全删除 launch.json 中的 port

作为参考,我正在 Windows 10 版本 1903 上的 Outlook 本机中运行此 Web 加载项。

据我所知,我的launch.json 似乎还可以:

  {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch index.html",
            "type": "office-addin",
            "request": "launch",
            "file": "${workspaceRoot}/index.html",
            "browserTarget": "Edge"
        },
        {
            "name": "Launch localhost with sourcemaps",
            "type": "office-addin",
            "request": "launch",
            "url": "http://localhost/mypage.html",
            "sourceMaps": true,
            "webRoot": "wwwroot",
            "webviewTarget": "Edge"
        },
        {
            "type": "office-addin",
            "request": "attach",
            "name": "Attach to Office Add-ins",
            "port": 53483,
            "trace": "verbose",
            "url": "https://localhost:4200/index.html?_host_Info=Outlook$Win32$16.01$en-US$$$$0",
            "webRoot": "${workspaceFolder}/app",
            "timeout": 45000
        }
     ]
  }

我已经多次浏览文档here,但没有运气。有谁知道如何解决这个问题,以便我可以为我的 Outlook Web 加载项运行调试器?

【问题讨论】:

    标签: visual-studio-code outlook windows-10 outlook-web-addins vscode-debugger


    【解决方案1】:

    如果您解决了这个问题,请回到这里并发表解释,以便您可以帮助我们,也可以帮助我们。

    注意:您需要用 office-js 标记您的 office-js 问题(这是 Office JS Microsoft 员工收听和回复的内容)

    同时 - 这种解决方法对我来说似乎很有用:

    把这个放到你的taskpane.html:

    <textarea id="out" rows=10 cols=46>debug info here</textarea>
    

    然后你可以使用这样的东西来代替console.log():-

    document.getElementById("out").value += "Ready...\n";
    

    另外 - 看起来您可以按照我的 cmets 安装 DevTools 和旧的 EdgeHTML 引擎(通过安装 JavascriptBrowser):Can someone from Microsoft please write a working instruction for how to debug Microsoft-365 Apps now-days (post-August-2021)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-09-03
      • 2023-04-10
      • 2017-02-16
      • 1970-01-01
      • 2020-11-20
      • 1970-01-01
      • 2020-02-02
      相关资源
      最近更新 更多