iot-edge-v1
iot-edge-v1 copied to clipboard
.Net Core binding dynamically add modules
Hi,
I would like to know if there is a plan to extend the Microsoft.Azure.Devices.Gateway.GatewayInterop to expose more of the gateway.dll functions?
I'm specially interested in being able to achieve same functionality as here from .NetCore application.
Or at least the ability to specify JSON configuration as string in addition to current option of specifying a path to JSON file in GatewayInterop.CreateFromJson(string file_path)
Regards, Ali
Hi @malichishti ,
Yes, we would like to do this work, however right now our backlog is pretty full.
But, if you take a look how we have done on GatewayInterop.CreateFromJson you can do the samething and use that. UpdateFromJsonis already exposed, so you can just pInvoke.
Just make sure that, for .NET Core, if you are creating a gateway from a managed .NEt Core application, you need to call the method: NetCoreInterop.InitializeDelegates();, otherwise you won't be able to load .NET Core Modules.
And as always feel free to send us a Pull Request if you want to contribute back.
Let me know if you have any questions.
Thanks!
Angelo Ribeiro.
Hi @aribeironovaes ,
How can we use the NetCoreInterop? I'm trying to create a managed gateway using the NuGet package, but only GatewayInterop is available for use.
Thanks!
Hi @fernandoBRS,
Take a look into this sample: https://github.com/Azure/iot-edge/tree/master/samples/dotnet_core_managed_gateway
Here we are using .NET Core to create a managed gateway.
You can just change the project to use the Nuget Packaget instead of adding the project directly.
Hope this helps,
Angelo Ribeiro.