How to debug IOT edge modules running as Linux containers from Visual studio

77 Views Asked by At

We have an IOT Edge application with multiple IOT C# modules. These IOT modules are containerized and deployed in Linux hardware. These IOT modules communicate using GRPC. We are using Visual studio 2022 for development and docker desktop for building docker images.

We are searching for any methodologies to debug the running containers from Visual studio . We have tried out debug by attaching container as process in Visual studio. But it’s not working.

Suggest any other methodologies to debug the containers from visual studio.

Thanks in advance.

We have tried to attach the containers as process in visual studio. But we are not able to debug as the visual studio is not able to read the auto generated PDB files

1

There are 1 best solutions below

0
On

Using this reference MSDOC we can develop and debug Azure IoT Edge modules using Visual Studio

Creating an Azure IoT Edge Project:

  • Launch Visual Studio 2022 and create a new project and search for “Azure IoT Edge.”

    • Choose the project template based on your device’s platform and architecture (e.g., Windows x64). and select the type of module (e.g., C# Module) and provide necessary information like Module Name and Repository URL and solution will have a main project folder containing EdgeAgent and EdgeHub, along with the C# module folder.

enter image description here

enter image description here

Developing the C# Module:

  • Open the C# module code file (Program.cs) in the module project folder and Customize the module code using C# and leverage the Azure IoT Hub SDKs for IoT functionalities.

enter image description here