iot-core-azure-dm-client
iot-core-azure-dm-client copied to clipboard
DM Hello World Build Errors
I'm getting two errors when trying to build after following the walkthrough DM Hello World Application - Coding.
The two errors are
error CS0539: 'AppDeviceManagementRequestHandler.IsSystemRebootAllowed()' in explicit interface
declaration is not a member of interface
error CS7069: Reference to type 'Task<>' claims it is defined in 'System.Runtime', but it could not be
found
Both of the errors appear to be stemmed around this class:
class AppDeviceManagementRequestHandler : IDeviceManagementRequestHandler
{
MainPage mainPage;
public AppDeviceManagementRequestHandler(MainPage mainPage)
{
this.mainPage = mainPage;
}
// Answer the question "is it OK to reboot the device"
async Task<bool> IDeviceManagementRequestHandler.IsSystemRebootAllowed()
{
return true;
}
}
Updating the Min version of my solution to Build 16299 and upgrading the Microsoft.Azure.Devices.Client nuget package version from 1.4.0 to 1.7.0 fixed most of the errors.
Now there's just on error left on this line:
IDeviceTwin deviceTwin = new AzureIoTHubDeviceTwinProxy(newDeviceClient, ResetConnectionAsync, Logger.Log);
The error:
error CS1503: Argument 2: cannot convert from 'method group' to 'EventWaitHandle'
I also had this issue but after looking at the samples I see that they actually use a EventWaitHandle which fixes this build error -
private EventWaitHandle _iotHubOfflineEvent;
IDeviceTwin deviceTwin = new AzureIoTHubDeviceTwinProxy(_deviceClient, _iotHubOfflineEvent, Logger.Log);
I guess the walk though is outdated.