ms-iot / azure-client-tools

Azure Client Tools
Other
43 stars 37 forks source link

AzureDeviceManagementClient.exe Can't load a custom plugin #16

Closed v-jiq closed 5 years ago

v-jiq commented 5 years ago

I want to load custom plugin ,So I create a new plugin and put it to Correct position and modify Related configuration file. The above operations are completely in accordance with the guidance of this document. -- https://github.com/ms-iot/azure-client-tools/blob/master/docs/device-agent/development-scenario/developer-plugin-creation.md .

But when I execute ".\AzureDeviceManagementClient.exe -debug" will can't normally running. below is log picture. the plugin name is DroneCtlPlugin.dll.

1553058827(1)
gmileka commented 5 years ago

Hi v-jiq,

We have seen similar logs when the plug-in had some missing dependencies. Is it possible that it requires some dlls and they are not at the same folder?

If that's not the case, I would recommend to temporary change the plug-in configuration from out-of-proc to in-proc. You can do that by changed the plug-in manifest file and setting the "outOfProc" to false. This should narrow down the problem - and the you can share the logs again...

Let us know how this goes...

thanks, george

v-jiq commented 5 years ago

Hi george, I have retried according to your guide , that temporary change the plug-in configuration from out-of-proc to in-proc.

the log prompts that failed to load library SampleComponentNamePlugin.dll. but I have putted SampleComponentNamePlugin.dll to Specified directory. The SampleComponentNamePlugin.dll are generate by refer to this link -- https://github.com/ms-iot/azure-client-tools/blob/master/docs/device-agent/development-scenario/developer-plugin-creation.md and no modify anything.

below is log:

1553234061

configure file:

1553237193(1)

dll:

1553237336(1)

Thanks

gmileka commented 5 years ago

Hi v-jiq,

The device agent finds the dll. So, your configuration seem to be fine.

The error returned is 193 - looking this up in Windows codes, it's "is not a valid Win32 application".

Does the architecture of the dll matches the architecture of the agent/device? (x64, win32, arm, etc).

thanks, george

v-jiq commented 5 years ago

Thanks george, as you said, the architecture error caused this problem!!