ms-iot / iot-core-azure-dm-client

Device Management Client for Windows IoT Core
Other
49 stars 53 forks source link

error on #include "SystemConfiguratorProxy_h.h" | "SystemConfiguratorProxy_h.h" not found #248

Closed jelletaal closed 6 years ago

jelletaal commented 6 years ago

after downloading this project and building it I ran into a multitude of errors

first, I had an error saying:

The Windows SDK version 10.0.15063.0 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". ServiceConfiguratorProxyClientLib C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Application Type\Windows Store\10.0\Platforms\Win32\PlatformToolsets\v141\Toolset.targets

I fixed this by installing Windows SDK version 10.0.15063.0 for Windows 10 and 8.1. after i had done that i ran into these errors:

Severity Code Description Project File Line Suppression State Error (active) E1696 cannot open source file "SystemConfiguratorProxy_h.h" ServiceConfiguratorProxyClientLib c:\Users\jellet\Source\Repos\iot-core-azure-dm-client-master\src\SystemConfiguratorProxy\Client\SCProxyClient.h 25
Error (active) E1696 cannot open source file "Windows.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlalloc.h 17
Error (active) E1696 cannot open source file "Ole2.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlalloc.h 18
Error (active) E1696 cannot open source file "Ole2.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlbase.h 67
Error (active) E1696 cannot open source file "comcat.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlbase.h 74
Error (active) E1696 cannot open source file "OleCtl.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlbase.h 82
Error (active) E1696 cannot open source file "Shlwapi.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlbase.h 98
Error (active) E1696 cannot open source file "Ole2.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlcomcli.h 17
Error (active) E1696 cannot open source file "OleCtl.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlcomcli.h 19
Error (active) E1696 cannot open source file "windef.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlconv.h 40
Error (active) E1696 cannot open source file "WinBase.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlconv.h 41
Error (active) E1696 cannot open source file "WinNls.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlconv.h 42
Error (active) E1696 cannot open source file "Windows.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlcore.h 24
Error (active) E1696 cannot open source file "Ole2.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlcore.h 25
Error (active) E1696 cannot open source file "winapifamily.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atldef.h 21
Error (active) E1696 cannot open source file "WinSock2.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atldef.h 720 Error (active) E1696 cannot open source file "Windows.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atldef.h 722 Error (active) E1696 cannot open source file "Windows.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlwinverapi.h 25
Error (active) E1696 cannot open source file "Ole2.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlwinverapi.h 26
Error (active) E1696 cannot open source file "sdkddkver.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\atlmfc\include\atlwinverapi.h 27
Error (active) E1696 cannot open source file "wrl/client.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\include\agile.h 16
Error (active) E1696 cannot open source file "winapifamily.h" ServiceConfiguratorProxyClientLib c:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt\corecrt.h 196 Error (active) E1696 command-line error: cannot open metadata file "C:\Users\jellet\Source\Repos\iot-core-azure-dm-client-master\src\Debug\DMMessage\Microsoft.Devices.Management.Message.winmd" ServiceConfiguratorProxyClientLib c:\Users\jellet\Source\Repos\iot-core-azure-dm-client-master\src\SystemConfiguratorProxy\Client\SCProxyClient.cpp 1

I can't figure out how to fix this issue if anyone knows please help me 😁

bderuijsscher commented 6 years ago

Hi, you probably need to retarget the solution to build for the latest 16299 as both minimum and target, this worked for me.

Also, make sure to checkout the latest version of this library and double check all the prerequisites are installed (as mentioned here https://github.com/ms-iot/iot-core-azure-dm-client/blob/master/README.md)

I hope this helps!

jelletaal commented 6 years ago

@bderuijsscher I have gone through and made sure I have all prerequisites listed here installed.

image

I retargeted the solution to 16299 like you said.

image

unluckily this didn't help. If you have any other suggestions they are welcome.

image

bderuijsscher commented 6 years ago

Hi Jelle, I was able to reproduce similar errors when upgrading the subprojects (SystemConfigurator etc.) in the solution. I would recommend to re-download the entire project from Github or checkout the latest version using your version control software, making sure to delete old files. Then open the project in Visual Studio, select "Toaster" and subsequently check if IoTDMClientLib (right click Properties) and Toaster if the minimum and target are set to 16299. The other subprojects need not to be upgraded.

jelletaal commented 6 years ago

I was able to get the application working after I downloaded the solution again. Thanks for the help. Right now I'm running the toaster application on my raspberry pi and the DMDashboard application locally and I'm trying to just reboot the device. when I look at the device running the toaster application I see the following error:

[AzureDM] [Error] DotNetty.Transport.Channels.ConnectException: LogError connecting to 13.95.15.251:8883 ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it at DotNetty.Transport.Channels.Sockets.SocketChannelAsyncOperation.Validate() at DotNetty.Transport.Channels.Sockets.TcpSocketChannel.DoFinishConnect(SocketChannelAsyncOperation operation) at DotNetty.Transport.Channels.Sockets.AbstractSocketChannel.AbstractSocketUnsafe.FinishConnect(SocketChannelAsyncOperation operation) --- End of inner exception stack trace --- at Microsoft.Azure.Devices.Client.DeviceClient.<>c.b74_2(Task t) at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() at System.Threading.Tasks.Task.<>c.<.cctor>b__276_1(Object obj) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Devices.Client.DeviceClient.d93.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Devices.Client.DeviceClient.d78.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at Microsoft.Devices.Management.AzureIoTHubDeviceTwinProxy.d10.MoveNext()

The connection strings on both devices are correct. Help is welcome. Thanks in advance

bderuijsscher commented 6 years ago

Hi Jelle,

judging by the error message, it appears as if some network blocking issues are the cause. You might want to check ping accees to that IP to see if basic connection attempts succeed.

jelletaal commented 6 years ago

Hi Bart,

when pinging this IP: image

But why does it need to go to this IP since I can read and write messages to and from the IoT hub in my own application whilst using the same connection string?

bderuijsscher commented 6 years ago

Hi Jelle,

you might want to check if this IP is related to the url as present in the connection string (nslookup of the said domainname). If it is, connection to the hub should probably fail as well.

Regards,

Bart

jelletaal commented 6 years ago

Hi Bart,

so I changed the protocol from amqp to amqp_websocket_only this seemed to solve this issue since port 8883 is closed and port 443 is open. so after doing that the console logged a lot of errors:

ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: timeInfo ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: timeInfo timeInfo = { "ntpServer": "time.windows.com", "timeZoneBias": 720, "timeZoneStandardBias": 0, "timeZoneStandardDate": "", "timeZoneStandardName": "Dateline Standard Time", "timeZoneStandardDayOfWeek": 0, "timeZoneDaylightBias": 0, "timeZoneDaylightDate": "", "timeZoneDaylightName": "Dateline Daylight Time", "timeZoneDaylightDayOfWeek": 0, "timeZoneKeyName": "Dateline Standard Time", "dynamicDaylightTimeDisabled": false } [AzureDM] [Error] Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Exception thrown: 'Microsoft.Devices.Management.Error' in IoTDMClient.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll [AzureDM] [Error] {"time":"2018-05-01T14:13:33.5438603+02:00","state":"failed","errSubSystem":"DeviceManagement","errCode":1722,"errContext":"Failure in SystemConfigurator SendRequest RPC"} ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: timeInfo ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: timeInfo ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: certificates ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: certificates certificates = { "rootCATrustedCertificates_Root": {}, "rootCATrustedCertificates_CA": {}, "rootCATrustedCertificates_TrustedPublisher": {}, "rootCATrustedCertificates_TrustedPeople": {}, "certificateStore_CA_System": {}, "certificateStore_Root_System": {}, "certificateStore_My_User": {}, "certificateStore_My_System": {} } [AzureDM] [Error] Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Exception thrown: 'Microsoft.Devices.Management.Error' in IoTDMClient.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll [AzureDM] [Error] {"time":"2018-05-01T14:13:41.7008519+02:00","state":"failed","errSubSystem":"DeviceManagement","errCode":1722,"errContext":"Failure in SystemConfigurator SendRequest RPC"} ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: certificates ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: certificates ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: rebootInfo ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: rebootInfo rebootInfo = { "singleRebootTime": "2016-10-10T17:00:00Z", "dailyRebootTime": "2016-10-10T17:00:00Z" } [AzureDM] [Error] Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Exception thrown: 'Microsoft.Devices.Management.Error' in IoTDMClient.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll [AzureDM] [Error] {"time":"2018-05-01T14:13:50.2002357+02:00","state":"failed","errSubSystem":"DeviceManagement","errCode":1722,"errContext":"Failure in SystemConfigurator SendRequest RPC"} ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: rebootInfo ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: rebootInfo ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsUpdatePolicy ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsUpdatePolicy windowsUpdatePolicy = { "applyProperties": { "allowAutoUpdate": 0, "sourcePriority": "remote" }, "reportProperties": "yes" } [AzureDM] [Error] Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Exception thrown: 'Microsoft.Devices.Management.Error' in IoTDMClient.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll [AzureDM] [Error] {"time":"2018-05-01T14:13:58.679975+02:00","state":"failed","errSubSystem":"DeviceManagement","errCode":1722,"errContext":"Failure in SystemConfigurator SendRequest RPC"} ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsUpdatePolicy ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsUpdatePolicy ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsUpdates ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsUpdates windowsUpdates = { "approved": "" } [AzureDM] [Verbose] WindowsUpdatesHandler.OnDesiredPropertyChange() [AzureDM] [Error] Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Exception thrown: 'Microsoft.Devices.Management.Error' in IoTDMClient.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll The thread 0xf44 has exited with code 0 (0x0). [AzureDM] [Error] {"time":"2018-05-01T14:14:07.1919466+02:00","state":"failed","errSubSystem":"DeviceManagement","errCode":1722,"errContext":"Failure in SystemConfigurator SendRequest RPC"} ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsUpdates ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsUpdates ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsTelemetry ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsTelemetry The thread 0xd20 has exited with code 0 (0x0). windowsTelemetry = { "level": "security" } [AzureDM] [Verbose] WindowsTelemetryHandler.OnDesiredPropertyChange() [AzureDM] [Error] Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Exception thrown: 'Microsoft.Devices.Management.Error' in IoTDMClient.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll [AzureDM] [Error] {"time":"2018-05-01T14:14:15.6649918+02:00","state":"failed","errSubSystem":"DeviceManagement","errCode":1722,"errContext":"Failure in SystemConfigurator SendRequest RPC"} ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsTelemetry ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: windowsTelemetry ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: deviceHealthAttestation ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: deviceHealthAttestation deviceHealthAttestation = { "Endpoint": "", "ReportIntervalInSeconds": -1 } ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: deviceHealthAttestation ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: deviceHealthAttestation ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: deviceHealthAttestation ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: wifi ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: wifi wifi = { "applyProperties": {}, "reportProperties": "yes" } [AzureDM] [Error] Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Sub-system=DeviceManagement, code=1722, messag=Failure in SystemConfigurator SendRequest RPC Exception thrown: 'Microsoft.Devices.Management.Error' in IoTDMClient.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll Exception thrown: 'Microsoft.Devices.Management.Error' in System.Private.CoreLib.dll [AzureDM] [Error] {"time":"2018-05-01T14:14:30.7143575+02:00","state":"failed","errSubSystem":"DeviceManagement","errCode":1722,"errContext":"Failure in SystemConfigurator SendRequest RPC"} ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: wifi ReportPropertiesAsync... [AzureDM] [Information] AzureIoTHubDeviceTwinProxy.ReportProperties [AzureDM] [Information] Reporting: windows [AzureDM] [Information] Reporting: wifi [AzureDM] [Verbose] ResetConnectionAsync end

thanks in advance.

bderuijsscher commented 6 years ago

Hi Jelle,

good, another step forward. This error points to a communication failure between your application (hosting the IoTDMClientLib) and the SystemConfigurator service that should be installed and running on the device.

You'll have to check that it is up and running (through powershell) and if that appears to be functioning properly I would advice to check past issue reports regarding this problem:

https://github.com/ms-iot/iot-core-azure-dm-client/search?q=systemconfigurator&type=Issues

I hope this helps, regards

jelletaal commented 6 years ago

Hi Bart,

How do I install the SystemConfigurator.exe and add it as a service? I have looked at this to connect with PowerShell and then followed this but after restarting the raspberry pi I don't see the service running.

I copied the SystemConfigurator.exe to documents, image and then ran this. image

Thanks in advance.

bderuijsscher commented 6 years ago

Hi Jelle,

you'd best install the executable in the c:\windows\system32 folder, then using powershell with administrator credentials run the following commands:

systemconfigurator.exe -install
net start systemconfigurator

Then, to verify if it runs properly either run

Get-Process

or

tlist

to check if the service is visible and running.

Please see this documentation for more information as part of the step by step walkthrough.

If, for some reason, there appear to be problems within this service, you'll need to investigate further using the instructions as mentioned here.

jelletaal commented 6 years ago

thanks for all your help. what do I fill into the approved spot in the DMDashboard. I know I have to fill in a GUID but where can I find those? image

is there a documentation that explains all the tabs in the DMDashboard?

also after adding the NuGet package, these warnings came up. I did build the library in release for al target platforms and they all succeeded before I made the nupkg. image

EDIT

After restarting visual studio I got a bunch of errors instead: image

how can I fix this? Thanks in advance

bderuijsscher commented 6 years ago

Sorry, I don't know of any documentation outlining every single tab in the DMDashboard, the source code should be quite self explanatory. Also, Windows Updates will be distributed automatically (probably overnight)

Check to see if you build for ARM (not x86 of x64), generally I tend to disable these in the build configuration. The reported errors point to a missing reference to IoTDMLib

jelletaal commented 6 years ago

when building the nupgk package do I need to build for arm last because when I try to only build ARM building the nupgk package doesn't work. image But when I build all three and add the nupgk to the solution it says this image

how do I fix that?

bderuijsscher commented 6 years ago

The IotDMLib project/solution needs to be built for all platforms, when I referred to only builing for ARM I was assuming the errors were generated in your software project that utilizes the nuget package.

So, you'll need to built the IoTDMLib for all platforms. Your own software solution that embeds the library can be safely built only for ARM.

jelletaal commented 6 years ago

Does that mean I need to put it on any CPU and put it on ARM if possible image and then build and run PackIoTDMClientLib.cmd 1.4.4 Release.

I did the building for al target platforms but i still get that warning image

How do i fix that? thanks in advance

bderuijsscher commented 6 years ago

No, you'll simply need to change the "Solution Platform" dropdown in the top of Visual Studio (next do Debug/Release dropdown) to ARM, then build solution, change it to x86 and build the solution etc. Do this for all three platforms and you should end up with the required binaries to build the nuget package.

jelletaal commented 6 years ago

that's exactly what I did but after I did that the solution that embeds the library came up with these warnings: image

EDIT

when building these errors pop up:

1>------ Build started: Project: WindowsUpdateAgent, Configuration: Debug ARM ------ 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3277: Found conflicts between different versions of "System.Runtime.Extensions" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3277: Found conflicts between different versions of "System.Xml.XDocument" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3277: Found conflicts between different versions of "System.Diagnostics.Debug" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3277: Found conflicts between different versions of "System.Threading.Tasks" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3277: Found conflicts between different versions of "System.Runtime.WindowsRuntime" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3277: Found conflicts between different versions of "System.Threading" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3277: Found conflicts between different versions of "System.Runtime" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3277: Found conflicts between different versions of "System.Linq" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3277: Found conflicts between different versions of "System.Collections" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(12,44,12,75): error CS0246: The type or namespace name 'IDeviceManagementRequestHandler' could not be found (are you missing a using directive or an assembly reference?) 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(19,20,19,51): error CS0246: The type or namespace name 'IDeviceManagementRequestHandler' could not be found (are you missing a using directive or an assembly reference?) 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(19,9,19,19): error CS0246: The type or namespace name 'Task<>' could not be found (are you missing a using directive or an assembly reference?) 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(19,20,19,51): error CS0538: 'IDeviceManagementRequestHandler' in explicit interface declaration is not an interface 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(30,36,30,60): error CS1983: The return type of an async method must be void, Task or Task 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(30,23,30,35): error CS0246: The type or namespace name 'Task<>' could not be found (are you missing a using directive or an assembly reference?) 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(55,28,55,48): error CS1983: The return type of an async method must be void, Task or Task 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(55,49,55,61): error CS0246: The type or namespace name 'DeviceClient' could not be found (are you missing a using directive or an assembly reference?) 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(55,23,55,27): error CS0246: The type or namespace name 'Task' could not be found (are you missing a using directive or an assembly reference?) 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(102,28,102,55): error CS1983: The return type of an async method must be void, Task or Task 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(102,23,102,27): error CS0246: The type or namespace name 'Task' could not be found (are you missing a using directive or an assembly reference?) 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(130,28,130,52): error CS1983: The return type of an async method must be void, Task or Task 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(130,53,130,67): error CS0246: The type or namespace name 'TwinCollection' could not be found (are you missing a using directive or an assembly reference?) 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(130,23,130,27): error CS0246: The type or namespace name 'Task' could not be found (are you missing a using directive or an assembly reference?) 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\WindowsUpdateAgent\WindowsUpdateAgent\StartupTask.cs(27,17,27,39): error CS0246: The type or namespace name 'DeviceManagementClient' could not be found (are you missing a using directive or an assembly reference?) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

bderuijsscher commented 6 years ago

Please verify that your solution has both 16299 as minimum and target version. Project -> .. properties -> Application. Also check that the IoTDMClientLib is present in the "references" pane of the Solution.

Then, do a Build -> Clean Solution and Build solution again.

jelletaal commented 6 years ago

I did that and now there are a lot less errors:

NU1605: Detected package downgrade: Microsoft.Azure.Devices.Client from 1.7.0 to 1.4.0. Reference the package directly from the project to select a different version. Backgroundwindowsupdate -> IoTDMClientLib 1.4.4 -> Microsoft.Azure.Devices.Client (>= 1.7.0) Backgroundwindowsupdate -> Microsoft.Azure.Devices.Client (>= 1.4.0) 1>------ Build started: Project: Backgroundwindowsupdate, Configuration: Debug ARM ------ 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(2052,5): warning MSB3277: Found conflicts between different versions of "Microsoft.WindowsAzure.Storage" that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed. 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\Backgroundwindowsupdate\Backgroundwindowsupdate\StartupTask.cs(100,42,100,68): error CS0012: The type 'DeviceClient' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Azure.Devices.Client, Version=1.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\Backgroundwindowsupdate\Backgroundwindowsupdate\StartupTask.cs(150,60,150,115): error CS0012: The type 'TwinCollection' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.Azure.Devices.Shared, Version=1.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

bderuijsscher commented 6 years ago

It seems that (part of) your solution references Microsoft.Azures.Devices.Client version 1.4.0 whilst it should require 1.7.0 or higher (just like the one referenced in IoTDMClientLib) You might want to correct this in the Nuget package manager.

jelletaal commented 6 years ago

Already a lot better just one error left:

1>------ Build started: Project: Backgroundwindowsupdate, Configuration: Debug ARM ------ 1> Backgroundwindowsupdate -> C:\Users\jellet\Source\Repos\Joheco IOT\code\Backgroundwindowsupdate\Backgroundwindowsupdate\bin\ARM\Debug\Backgroundwindowsupdate.winmd 1>C:\Users\jellet\Source\Repos\Joheco IOT\code\Backgroundwindowsupdate\Backgroundwindowsupdate\bin\ARM\Debug\AppxManifest.xml : error APPX0501: Validation error. error 80080204: App manifest validation error: Line 41, Column 12, Reason: If it is not an audio background task, it is not allowed to have EntryPoint="Backgroundwindowsupdate.StartupTask" without ActivatableClassId in windows.activatableClass.inProcessServer. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I think all the errors regarding the IoTClientlib have been solved I just have an error for the UWP left. I'm trying to build it in a background application.

image

bderuijsscher commented 6 years ago

Yes, this seems like a (illegitimate?) use of a capability in the manifest. Either omit this capability or implement the directions as shown in the error message. Unfortunately I am not familiar with this capability.

jelletaal commented 6 years ago

Hi Bart, Thanks for your help, I don't have any errors anymore but do you know why nothing is logging in the output field of debug

Thanks in advance

bderuijsscher commented 6 years ago

Hi Jelle,

sorry for the late reply. As far as i know some debugging output should be visible. Have you attempted to use a more advanced logging solution such a Serilog? Most of your code would benefit from the modular approach of such frameworks in order to ease debugging.

On the other hand, if you need more precise control over possible debugging issues with the SystemConfigurator service you might want to consider the advice a given here

Regards

jelletaal commented 6 years ago

I ended up just replacing the logger with my own logger. which seemed to work. Now I'm just wondering what the fields of the DMDashboard do and what to fill the text fields to make them work.

I really like to thank you I wouldn't have been able to get it to work without your help, thanks.

bderuijsscher commented 6 years ago

Hi Jelle, you're welcome, good to hear you are progressing. The fields in DMDashboard represent many of the available Device Twin properties that are used to manage the device settings through IoT Hub (see more information here or a more high level start here).

The DMDashboard example program retrieves these properties via Iot Hub and can populate these in the fields of the UI. Many of them can also be set through this example program.

If you would like to manipulate the properties more directly, I would recommend using Device Explorer (see here, find SetupDeviceExplorer.msi). It more easily allows you to retrieve and manipulate device twin information for a given device through the IoT Hub. Furthermore, you can send commands directly to the device such as windows.rebootAsync for a reboot (beware: will execute 5 minutes after the command).

Regards

gmileka commented 6 years ago

I'm closing this. Please, re-open if help is still needed.