简体   繁体   English

调试 Azure IoT Edge 模块 C#(如何下断点)

[英]Debugging Azure IoT Edge Module C# (how to hit a breakpoint)

I am trying to debug an IoT edge module.我正在尝试调试 IoT 边缘模块。 According to https://docs.microsoft.com/en-us/azure/iot-edge/how-to-vs-code-develop-module?view=iotedge-2018-06#build-and-run-container-for-debugging-and-debug-in-attach-mode I should (2) right-click on deployment.debug.template.json but I don't see that file.根据https://docs.microsoft.com/en-us/azure/iot-edge/how-to-vs-code-develop-module?view=iotedge-2018-06#build-and-run-container- for-debugging-and-debug-in-attach-mode我应该(2)右键单击deployment.debug.template.json但我没有看到那个文件。 There is a file called module.json and when I right-click on it I see:有一个名为module.json的文件,当我右键单击它时,我看到:

在此处输入图像描述

Is there a way to do this in VS that would be easier?有没有办法在 VS 中更容易做到这一点?

If you just want to hit a breakpoint, and don't need to run the module as a container on your dev machine, you can follow these steps .如果您只想打断点,并且不需要在您的开发机器上将模块作为容器运行,您可以按照以下步骤操作。 That way you're using the IoT Edge Simulator instead of running it on the IoT Edge Runtime.这样,您就可以使用 IoT Edge 模拟器,而不是在 IoT Edge 运行时运行它。 When you run it this way, you supply the simulator with a device connection string (you can just create a new one in an IoT Hub) and the simulator will create a new module called target on the device in IoT Hub.当你以这种方式运行它时,你为模拟器提供了一个设备连接字符串(你可以在 IoT Hub 中创建一个新的),模拟器将在 IoT Hub 的设备上创建一个名为target的新模块。 You can interact with the module (Direct Methods, Module Twins) by targeting that module.您可以通过定位该模块与模块(直接方法、模块孪生)进行交互。

Alternatively, if you do want to follow the steps in the link you provided, you do need that deployment file.或者,如果您确实想按照您提供的链接中的步骤进行操作,则确实需要该部署文件。 When you create a new IoT Edge Solution using VS Code, it will supply this file for you.当您使用 VS Code 创建新的 IoT Edge 解决方案时,它将为您提供此文件。 Example:例子:

启动项目

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C# 断点命中调试器 - C# Breakpoint hit the debugger 调试混合模式应用程序(C#和非托管C ++)时出现“当前不会遇到断点”错误 - “The breakpoint will not currently be hit” error while debugging a mixed mode application (c# and unmanaged c++) Azure IoT Edge 以编程方式停止模块 - Azure IoT Edge stop a module programmatically C# Visual Studio 服务调试“当前不会命中断点。没有为此文档加载任何符号” - C# Visual Studio Service Debugging "The breakpoint will not currently be hit. No Symbols have been loaded for this document" IoT Edge 模块 - 远程调试 python 模块问题 - IoT Edge Module - Remotely debugging python module issue 如何在IoT Edge模块中读取Module twin? - How to read Module twin in IoT Edge module? Azure IOT EDGE 使用 c# 从 EGDE 获取资源属性 - Azure IOT EDGE Get resource properties from EGDE using c# 断点当前不会被命中 - 远程调试 - The breakpoint will not currently be hit - Remote Debugging 如何使用IoT设备SDK连接到IoT Edge系统模块 - How to connect to IoT Edge System Module using IoT Device SDK 在C#中调试时,FileSystemWatcher没有达到断点 - FileSystemWatcher is not hitting the breakpoint while debugging in C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM