3

I' following this article to develop an IoT edge solution. But while debugging I'm getting the following error:

Unhandled Exception: System.AggregateException: One or more errors occurred. (Environment variable IOTEDGE_WORKLOADURI is required.) ---> System.InvalidOperationException: Environment variable IOTEDGE_WORKLOADURI is required.at Microsoft.Azure.Devices.Client.Edge.EdgeModuleClientFactory.CreateInternalClientFromEnvironmentAsync()
   at SampleModule.Program.Init() in D:\IoT Arch POC\EdgeSolution2\modules\SampleModule\Program.cs:line 49

Found one post in git hub, but that is not helpful, this

Alex
  • 734
  • 6
  • 29

2 Answers2

1

Add the following to your .csproj file:

<ItemGroup>
  <ProjectCapability Include="AzureIoTEdgeModule" />
</ItemGroup>
cdjc
  • 1,039
  • 12
  • 24
1

You are probably trying to run an Iot-Edge Module as a stand alone C# program? That won't work. An IoT-Edge Module must be run in the IoT-Edge or IoT-Edge simulator.

GGleGrand
  • 1,565
  • 1
  • 20
  • 45