question

DeichaAndreas-7894 avatar image
0 Votes"
DeichaAndreas-7894 asked asergaz commented

Cannot create C# iot edge module in vscode

When I try to create a C# module in vscode using ctrl+shift+p and 'Azure IoT Edge: Add IoT Edge Module', I get the following error message:

Running Docker version
Client:
Cloud Integration: v1.0.23
Version: 20.10.14
API version: 1.41
Go version: go1.16.15
Git commit: a224086
Built: Thu Mar 24 01:53:11 2022
Operating system/Arch: windows/amd64
Context: standard
Experimental: true

Server: Docker Desktop 4.7.1 (77678)
Engine:
Version: 20.10.14
API version: 1.41 (minimum version 1.12)
Go version: go1.16.15
Git commit: 87a90dc
Built: Thu Mar 24 01:46:14 2022
Operating system/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.5.11
GitCommit: 3df54a852345ae127d1fa3092b95168e4a88e2f8
runc:
Version: 1.0.3
GitCommit: v1.0.3-0-gf46b6ba
docker-init:
Version: 0.19.0
GitCommit: de40ad0
The specified iotedgehubdev version is: 0.14.14
azure-iot-edge.buildAndRunSolution:
azure-iot-edge.setupIotedgehubdev:
azure-iot-edge.buildAndRunSolution: azure-iot-edge.buildAndRunSolution:
azure-iot-edge.addModule:
Running dotnet new -i Microsoft.Azure.IoT.Edge.Module::3.0.0-alpha
The following template packages will be installed:
Microsoft.Azure.IoT.Edge.Module::3.0.0-alpha

"Microsoft.Azure.IoT.Edge.Module::3.0.0-alpha" is already installed.
Error: Please make sure that the prerequisites for the C# module are installed. Error: command failed with exit code 2147614729. Detail: "Microsoft.Azure.IoT.Edge.Module::3.0.0-alpha" is already installed.

azure-iot-edge.addModule:
Run dotnet new -i Microsoft.Azure.IoT.Edge.Module::3.0.0-alpha.
The following template packages are installed:
Microsoft.Azure.IoT.Edge.Module::3.0.0-alpha

"Microsoft.Azure.IoT.Edge.Module::3.0.0-alpha" is already installed.
Error: Please make sure that the prerequisites for the C# module are installed. Error: command failed with exit code 2147614729. Detail: "Microsoft.Azure.IoT.Edge.Module::3.0.0-alpha" is already installed.




I checked again to make sure all the prerequisites are installed correctly. According to Azure IoT Edge for Visual Studio code documentation, the following must be met.

  • .NET Core 2.1 SDK or higher. (.NET Core 3.0 SDK or higher is required for ARM64 (Preview) support. Please see the instructions here for more details).

  • C# for Visual Studio Code (powered by OmniSharp) Extension

  • Requirements for the Azure IoT Edge extension --> which are (Docker, Python and Pip and iotedgehubdev)



.Net Core 2.1 SDK >
196876-image.png

C# for Visual Studio Code
196926-image.png

Docker
196900-image.png

Python and Pip
196952-image.png

iotedgehubdev
196971-image.png






Can anybody help?


azure-iot-edge
image.png (10.9 KiB)
image.png (49.9 KiB)
image.png (14.8 KiB)
image.png (5.5 KiB)
image.png (42.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DeichaAndreas-7894 avatar image
2 Votes"
DeichaAndreas-7894 answered asergaz commented

I solved it

first updated to 3.1.1:
dotnet new --install Microsoft.Azure.IoT.Edge.Module::3.1.1

vscode restart
dotnet new aziotedgemodule -n "YourModuleName" -r localhost:5000/YourModuleName

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@DeichaAndreas-7894 thank you for sharing the resolution :). Will help others for sure.

Happy coding!

0 Votes 0 ·