[英]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.