Using VS 2022 not able to create module in IOT Edge project

Deepak Singh Rawat [DKSR] 0 Reputation points
2023-09-14T11:03:26.9866667+00:00

Hi,

I am creating an IOT edge project by following the steps mentioned in "https://learn.microsoft.com/en-us/azure/iot-edge/how-to-visual-studio-develop-module?view=iotedge-1.4&pivots=iotedge-dev-cli" but Visual studio is creating an incomplete project, custom edge module is missing. Neither I am getting any error nor It is creating any module.

You can refer attached screenshot. edge module is missing.IOT_EDGE

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
576 questions
{count} votes

4 answers

Sort by: Most helpful
  1. Sander van de Velde | MVP 33,146 Reputation points MVP
    2023-09-14T13:24:59.05+00:00

    Hello @Deepak Singh Rawat [DKSR] ,

    welcome to this moderated community forum.

    This is by design. The template should be used in combination with the Visual Studio Code tooling as seen in the prerequisites.

    Visual Studio Code is more focused on folders instead of Visual Studio solutions and projects.

    Personally, the VS Code editor is more than sufficient for building and deploying Azure IoT Edge modules.

    If you really want to use Visual Studio, start a new project using the available IoT template found in Visual Studio, using the Azure IoT Edge tools for VS2022 extension:

    User's image


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    1 person found this answer helpful.

  2. Pat Altimore 6 Reputation points Microsoft Employee
    2024-05-17T17:28:24.8166667+00:00

    The Azure IoT Edge tools for Visual Studio extension is missing the project templates for C and C# modules. We are working to resolve the issue. If you can't create IoT Edge modules using the extension, use the following workaround.

    Download the following files and place them in the listed Visual Studio template directory:

    Template file Add to directory
    azureiotedgemodule-v0.0.4.zip %userprofile%\Documents\Visual Studio 2022\Templates\ProjectTemplates\Visual C#
    azureiotedgevcmodulevs17-v0.0.9.zip %userprofile%\Documents\Visual Studio 2022\Templates\ProjectTemplates\Visual C++ Project
    1 person found this answer helpful.

  3. Poluru Sairam Sekhar 31 Reputation points
    2024-05-18T04:44:31.4866667+00:00

    Hi @Deepak Singh Rawat [DKSR],

    There is a workaround for this. You can import projects into Visual Studio created from the following commands.

    1. Install docker
      1. Download and install Docker Desktop from Docker Desktop: The #1 Containerization Tool for Developers | Docker 
      2. Use WSL 2 instead of Hyper-V" option on the Configuration page is either selected or not selected based on the preferred backend. 
      3. Follow the instructions on the installation wizard to authorize the installer and proceed with the installation. 
      4. When the installation is successful, select Close to complete the installation process. 
    2. Download and install Azure CLI from https://aka.ms/installazurecliwindows 
    3. Install the latest Azure CLI 
    4. Run the command: az extension add --name azure-iot
    5. Download and install Python from Download Python | Python.org 
    6. Run the command: pip install iotedgedev
    7.  Run the command: iotedgedev new edgesolution (or) iotedgedev solution init --template csharp 
    8. Run the command: iotedgedev iothub setup
    9. Start the container
      1. docker run -it -v /var/run/docker.sock:/var/run/docker.sock -v c:/temp/iotedge:/home/iotedge microsoft/iotedgedev 
    10. Add modules to IoT Edge solution 
      1. iotedgedev add <module-name--template <template> 
    11. Build IoT Edge module images 
      1. iotedgedev build
    12. Setup IoT Edge simulator
      1. iotedgedev setup 
    13. Start the IoT Edge simulator to run the solution 
      1. iotedgedev start (or) iotedgedev start --setup --file config/deployment.amd64.json 
    14. Monitor messages sent from IoT Edge Simulator to IoT Hub 
      1. iotedgedev monitor 
    15. Stop the IoT Edge simulator
      1. iotedgedev stop
    16. Push IoT Edge module images 
      1. iotedgedev push

  4. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.