Azure / Azure/azure-iot-sdk-csharp
Not able to restart the custom edge module while using the inbuilt "RestartModule" direct method of $edgeAgent from custom iot edge module.
- Dominant language
- C#
- Stars
- 477
- Forks
- 492
- Avg merge
- 9h 55m
- Merged PRs (30d)
- 2
Description
Expected Behavior:
We can restart the custom module by invoking the $edgeAgent "RestartModule" direct method.But as of now it will be giving the error.

Steps to Reproduce:
Provide a detailed set of steps to reproduce the bug.
1. I am using the .NET sdk for invoking the inbuilt direct method of $edgeAgent.(Note: Calling the inbuilt direct method from the custom module not from $edgeAgent itself.)
2. Code snippet (C#):
```
var DataAsJson = @"{
""schemaVersion"": ""1.0"",
""id"": ""edgemodule1""
}";
var methodRequest = new MethodRequest("RestartModule", Encoding.UTF8.GetBytes(DataAsJson), TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(30));
var result = await _moduleClient.InvokeMethodAsync("DeviceId","$edgeAgent", methodRequest);
```
3. After deploying the module when we invoking the direct method calls it will give the error as shown in image.
Contributor guide
Research direction
No repository file or test is named. Start by reproducing the issue with the provided C# MethodRequest and RestartModule payload from a custom IoT Edge module, recording the returned error rather than relying on the screenshot. Done means the custom module can be restarted through $edgeAgent's RestartModule direct method.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- api, embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100