{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/iot-gateway-opc-ua/issues/28","repository_url":"https://api.github.com/repos/Azure/iot-gateway-opc-ua","labels_url":"https://api.github.com/repos/Azure/iot-gateway-opc-ua/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/Azure/iot-gateway-opc-ua/issues/28/comments","events_url":"https://api.github.com/repos/Azure/iot-gateway-opc-ua/issues/28/events","html_url":"https://github.com/Azure/iot-gateway-opc-ua/issues/28","id":226307086,"number":28,"title":"Error loading 'dotnetcore' thrown from GatewayInterop.CreateFromJson","user":{"login":"brnkrygs","id":3408210,"avatar_url":"https://avatars2.githubusercontent.com/u/3408210?v=3","gravatar_id":"","url":"https://api.github.com/users/brnkrygs","html_url":"https://github.com/brnkrygs","followers_url":"https://api.github.com/users/brnkrygs/followers","following_url":"https://api.github.com/users/brnkrygs/following{/other_user}","gists_url":"https://api.github.com/users/brnkrygs/gists{/gist_id}","starred_url":"https://api.github.com/users/brnkrygs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brnkrygs/subscriptions","organizations_url":"https://api.github.com/users/brnkrygs/orgs","repos_url":"https://api.github.com/users/brnkrygs/repos","events_url":"https://api.github.com/users/brnkrygs/events{/privacy}","received_events_url":"https://api.github.com/users/brnkrygs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-05-04T14:50:56Z","updated_at":"2017-05-05T20:09:48Z","closed_at":null,"body":"Hi!\r\n\r\nFirst, I'd like to say thank you for putting this tool/example together.  It has some exciting possibilities for us, and I especially appreciate the work you've done to get everything published up to NuGet.  The build experience getting this all going was *dramatically* improved in the recent release.\r\n\r\nThat said, we're hitting a problem running this project on some dedicated gateway hardware running Windows Server 2016 Standard.\r\n\r\nEverything worked OK on my dev box with visual studio installed, but when I tried to run the project on our server, I got the following error right after the Gateway config file was successfully patched:\r\n\r\n```\r\nUnhandled Exception: System.DllNotFoundException: Unable to load DLL 'dotnetcore': The specified module could not be found. (Exception from HRESULT: 0x8007007E)\r\n   at Microsoft.Azure.Devices.Gateway.NetCoreInterop.InitializeDelegatesOnNative(IntPtr createAddress, IntPtr receiveAddress, IntPtr destroyAddress, IntPtr startAddress)\r\n   at Microsoft.Azure.Devices.Gateway.NetCoreInterop.InitializeDelegates()\r\n   at Microsoft.Azure.Devices.Gateway.GatewayInterop.CreateFromJson(String file_path)\r\n   at GatewayApp.NetCore.Program.Main(String[] args)\r\n```\r\n\r\nI tried running the dll published from our dev box, and I tried building right on the server with the `dotnet clr`.  I also tried configuring the Gateway project to emit an `.exe` instead of a `.dll`. No luck either way.  Any ideas?\r\n\r\nI posted a gist with a log of the commands we ran here:\r\nhttps://gist.github.com/brnkrygs/c76f9f1cede12f6f218a9e4860add342\r\n\r\nA couple of potentially interesting things: \r\n\r\n 1. I'm using the latest stable `dotnet core` version of `1.0.3`\r\n 2. In order to `dotnet restore` on the gateway box, I had to `dotnet migrate`, which reported success\r\n\r\nThanks again for your attention and effort!"},"comment":{"url":"https://api.github.com/repos/Azure/iot-gateway-opc-ua/issues/comments/299563878","html_url":"https://github.com/Azure/iot-gateway-opc-ua/issues/28#issuecomment-299563878","issue_url":"https://api.github.com/repos/Azure/iot-gateway-opc-ua/issues/28","id":299563878,"user":{"login":"brnkrygs","id":3408210,"avatar_url":"https://avatars2.githubusercontent.com/u/3408210?v=3","gravatar_id":"","url":"https://api.github.com/users/brnkrygs","html_url":"https://github.com/brnkrygs","followers_url":"https://api.github.com/users/brnkrygs/followers","following_url":"https://api.github.com/users/brnkrygs/following{/other_user}","gists_url":"https://api.github.com/users/brnkrygs/gists{/gist_id}","starred_url":"https://api.github.com/users/brnkrygs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brnkrygs/subscriptions","organizations_url":"https://api.github.com/users/brnkrygs/orgs","repos_url":"https://api.github.com/users/brnkrygs/repos","events_url":"https://api.github.com/users/brnkrygs/events{/privacy}","received_events_url":"https://api.github.com/users/brnkrygs/received_events","type":"User","site_admin":false},"created_at":"2017-05-05T20:09:48Z","updated_at":"2017-05-05T20:09:48Z","body":"Thanks for the suggestion @barnstee \r\n\r\nI downloaded the NetCoreSDK as close to 1.0.0 as I could get... this is what I found:\r\n\r\nhttps://github.com/dotnet/core/blob/master/release-notes/download-archive.md\r\n\r\nI downloaded and installed both the 32-bit and 64-bit SDK Installer from here:\r\n.NET Core 1.0 SDK Preview 2 build 3121\r\nhttps://github.com/dotnet/core/blob/master/release-notes/download-archives/1.0-preview2-download.md\r\n\r\nand removed all traces I could find to my original sdk install.\r\n\r\nThen, downloaded a fresh copy of the `iot-gateway-opc-ua` release from github.\r\n\r\n`dotnet restore` worked out of the box this time - no `dotnet migrate` needed.\r\n\r\n`dotnet publish` also worked, and looked like this:\r\n\r\n```\r\nPS C:\\Support\\iot-gateway-opc-ua-1.0.0\\iot-gateway-opc-ua-1.0.0> dotnet publish .\\src\\GatewayApp.NetCore\\\r\nPublishing GatewayApp.NetCore for .NETCoreApp,Version=v1.0\r\nProject IoTHubCredentialTools (.NETStandard,Version=v1.3) will be compiled because expected outputs are missing\r\nCompiling IoTHubCredentialTools for .NETStandard,Version=v1.3\r\n\r\nCompilation succeeded.\r\n    0 Warning(s)\r\n    0 Error(s)\r\n\r\nTime elapsed 00:00:12.0512835\r\nProject Opc.Ua.Publisher.Module (.NETStandard,Version=v1.3) will be compiled because dependencies changed\r\nCompiling Opc.Ua.Publisher.Module for .NETStandard,Version=v1.3\r\n\r\nCompilation succeeded.\r\n    0 Warning(s)\r\n    0 Error(s)\r\n\r\nTime elapsed 00:00:12.2649834\r\nProject GatewayApp.NetCore (.NETCoreApp,Version=v1.0) will be compiled because dependencies changed\r\nCompiling GatewayApp.NetCore for .NETCoreApp,Version=v1.0\r\n\r\nCompilation succeeded.\r\n    0 Warning(s)\r\n    0 Error(s)\r\n\r\nTime elapsed 00:00:12.0037659\r\n\r\n\r\npublish: Published to C:\\Support\\iot-gateway-opc-ua-1.0.0\\iot-gateway-opc-ua-1.0.0\\src\\GatewayApp.NetCore\\bin\\Debug\\netcoreapp1.0\\publish\r\nPublished 1/1 projects successfully\r\n```\r\n\r\nI jumped into the publish directory:\r\n\r\n\r\n`PS C:\\Support\\iot-gateway-opc-ua-1.0.0\\iot-gateway-opc-ua-1.0.0> cd .\\src\\GatewayApp.NetCore\\bin\\Debug\\netcoreapp1.0\\publish\\`\r\n\r\nand ran the published dll, but got the same error:\r\n\r\n```\r\nPS C:\\Support\\iot-gateway-opc-ua-1.0.0\\iot-gateway-opc-ua-1.0.0\\src\\GatewayApp.NetCore\\bin\\Debug\\netcoreapp1.0\\publish> dotnet .\\GatewayApp.NetCore.dll IotHub \"<our connection string>\"\r\nTarget system is Windows.\r\nTarget system is 64-bit.\r\nGateway config file patched with application name: IotHub\r\nAttemping to register ourselves with IoT Hub using owner connection string: <our connection string>\r\nAttemping to read connection string from secure store with certificate name: IotHub\r\nAttemping to configure publisher with connection string: <our connection string>\r\nGateway config file patched with IoT Hub name: <our iot hub name>\r\n\r\nUnhandled Exception: System.DllNotFoundException: Unable to load DLL 'dotnetcore': The specified module could not be found. (Exception from HRESULT: 0x8007007E)\r\n   at Microsoft.Azure.Devices.Gateway.NetCoreInterop.InitializeDelegatesOnNative(IntPtr createAddress, IntPtr receiveAddress, IntPtr destroyAddress, IntPtr startAddress)\r\n   at Microsoft.Azure.Devices.Gateway.NetCoreInterop.InitializeDelegates()\r\n   at Microsoft.Azure.Devices.Gateway.GatewayInterop.CreateFromJson(String file_path)\r\n   at GatewayApp.NetCore.Program.Main(String[] args)\r\nPS C:\\Support\\iot-gateway-opc-ua-1.0.0\\iot-gateway-opc-ua-1.0.0\\src\\GatewayApp.NetCore\\bin\\Debug\\netcoreapp1.0\\publish>\r\n```\r\nDid I grab the right version of .NetCore1.0.0?  Any other thoughts?  We also have a full version of the .NET Framework installed on that box... somewhere around 4.6 (supporting netstandard1.3), if that matters."}}
{"actor":{"display_login":"brnkrygs"}}