英文:
What is the right launch configuration to debug an event-based Outlook add-in?
问题
我正在编写一个由Yeoman生成的Outlook插件,该插件运行基于事件的代码。具体来说,该插件使用onMessageSendHandler
操作来对发送的电子邮件消息进行轻微修改。
我正在按照官方说明在Visual Studio Code中“调试基于事件的Outlook插件”。我发现一直以来,我在我的代码上设置的断点都没有被捕获。这包括在我的onMessageSendHandler
操作代码上设置的任何断点。
上述说明提供了在launch.json
中使用的以下Visual Studio Code启动配置:
{
"name": "Direct Debugging",
"type": "node",
"request": "attach",
"port": 9223,
"protocol": "inspector",
"timeout": 600000,
"trace": true
}
这段代码存在两个问题:
- 在许多地方,存在一个不可见的
U+202f
字符,而不是单个空格字符。 "protocol"
属性在我的Visual Studio Code(v1.78.2)中标记为不允许使用。
在解决了问题#1之后,我的问题是问题#2是否是我的断点未被捕获的原因? 我如何修复这些问题,以便我的断点 - 具体说是在事件操作内部 - 能够被捕获?
诊断详细信息
- Windows 10
- Node.js 18.16.0
- Visual Studio Code 1.78.2
- 在VS Code中安装的包:
dbaeumer.vscode-eslint@2.4.0 esbenp.prettier-vscode@9.13.0 ms-azuretools.vscode-azureresourcegroups@0.7.5 ms-azuretools.vscode-azurestorage@0.15.2 ms-azuretools.vscode-docker@1.25.1 ms-edgedevtools.vscode-edge-devtools@2.1.1 ms-python.isort@2022.8.0 ms-python.python@2023.8.0 ms-python.vscode-pylance@2023.5.40 ms-toolsai.jupyter@2023.4.1011241018 ms-toolsai.jupyter-keymap@1.1.0 ms-toolsai.jupyter-renderers@1.0.15 ms-toolsai.vscode-jupyter-cell-tags@0.1.8 ms-toolsai.vscode-jupyter-slideshow@0.1.5 ms-vscode-remote.remote-containers@0.292.0 ms-vscode-remote.remote-wsl@0.78.8 ms-vscode.azure-account@0.11.5 ms-vscode.powershell@2023.5.0 NilsSoderman.batch-runner@1.0.1 redhat.vscode-xml@0.25.0
英文:
I am coding a Yeoman-generated Outlook add-in that runs event-based code. Specifically, the add-in uses the onMessageSendHandler
action to make slight modifications to outgoing email messages.
I am following the official instructions to "debug your event-based Outlook add-in" in Visual Studio Code. I find that consistently, no breakpoints that I set on my code are ever caught. This includes any breakpoints set on my onMessageSendHandler
action code.
The instructions above provide the following Visual Studio Code launch configuration to use in launch.json
:
{
"name": "Direct Debugging",
"type": "node",
"request": "attach",
"port": 9223,
"protocol": "inspector",
"timeout": 600000,
"trace": true
}
This bit of code has two issues:
- In many places, instead of a single space character, an invisible
U+202f
character is present. - The
"protocol"
property is marked as not allowed in my Visual Studio Code (v1.78.2).
Having fixed issue #1, my question is might issue #2 be the reason my breakpoints are not caught? How can I fix things so that my breakpoints - specifically inside the event action - are caught?
Diagnostic details
-
Windows 10
-
Node.js 18.16.0
-
Visual Studio Code 1.78.2
-
Packages installed in VS Code:
dbaeumer.vscode-eslint@2.4.0 esbenp.prettier-vscode@9.13.0 ms-azuretools.vscode-azureresourcegroups@0.7.5 ms-azuretools.vscode-azurestorage@0.15.2 ms-azuretools.vscode-docker@1.25.1 ms-edgedevtools.vscode-edge-devtools@2.1.1 ms-python.isort@2022.8.0 ms-python.python@2023.8.0 ms-python.vscode-pylance@2023.5.40 ms-toolsai.jupyter@2023.4.1011241018 ms-toolsai.jupyter-keymap@1.1.0 ms-toolsai.jupyter-renderers@1.0.15 ms-toolsai.vscode-jupyter-cell-tags@0.1.8 ms-toolsai.vscode-jupyter-slideshow@0.1.5 ms-vscode-remote.remote-containers@0.292.0 ms-vscode-remote.remote-wsl@0.78.8 ms-vscode.azure-account@0.11.5 ms-vscode.powershell@2023.5.0 NilsSoderman.batch-runner@1.0.1 redhat.vscode-xml@0.25.0
答案1
得分: 1
当使用像在 launch.json
文件中所示的检查器协议启动时,Node.js 进程会监听调试客户端(强制使用基于 inspector
协议的 Node 调试器实现)。它支持以下版本:
node.js < 8.x | >= 6.3(Windows:>= 6.9)
此外,您可能会发现 Protocol: "inspector" inside launch.json is ignored 帖子有帮助。
请注意,要能够调试启动事件,您需要附加调试器,然后运行调试器。
英文:
When started with the inspector protocol like shown in the launch.json
file, a Node.js process listens for a debugging client (forces the node debugger to use the inspector
protocol based implementation). It is supported by the following versions:
node.js < 8.x | >= 6.3 (Windows: >= 6.9)
Also you may find the Protocol: "inspector" inside launch.json is ignored post helpful.
Note, to be able to debug launch events you need to Attach the debugger and then Run the debugger.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论