kexplo / electron-edge

Run .NET and Node.js code in-process on Electron
http://tjanczuk.github.io/edge
Other
427 stars 36 forks source link

Edge with .net core external dll sample required. #40

Open weliwita opened 7 years ago

weliwita commented 7 years ago

I found this thread useful in this regard. https://github.com/tjanczuk/edge/issues/463. But I could not get this to work after building .net core project and generating .deps file. The electron app crashes as soon as I set EDGE_APP_ROOT to deps file location. Everything working fine when dotnetcore code running inline with javascript. But I can't get external dotnetcore dll referenced. I couldn't find any step by step documentation or sample app in this regard, except for the thread above.

Here are the steps I followed,

  1. Create electron quick start app.
  2. Set the global.json to point to preview version of dotnetcore as newer version gave me build errors with electron-edge.
    {
    "sdk": {
    "version": "1.0.0-preview2-003121"
    }
    }
  3. Install electron-edge npm install electron-edge
  4. Ran helloworld sample. Working fine with dot net framework.
  5. set EDGE_USE_CORECLR=1
  6. Ran helloworld sample. Working fine with core clr.
  7. Create new dotnet core class library project with same sdk version 1.0.0-preview2-003121
  8. Added Edge.js nuget
    {
    "version": "1.0.0-*",
    "buildOptions": {
    "debugType": "portable"
    },
    "dependencies": {},
    "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
        "type": "platform",
        "version": "1.0.0"
        },
        "Edge.js": "6.5.0"
      }
    }
    }
    }
  9. With dotnet restore and dotnet build created deps file and the dll
  10. When I point the EDGE_APP_ROOT to the debug folder where deps file and dll lives and run my electron app it crashes. Event log has following error.
    Faulting application name: electron.exe, version: 1.6.8.0, time stamp: 0x5907b4b0
    Faulting module name: KERNELBASE.dll, version: 10.0.15063.296, time stamp: 0xa0527b0c
    Exception code: 0xc0000005
    Fault offset: 0x0000000000030b24
    Faulting process id: 0x20e0
    Faulting application start time: 0x01d2d515deabec6f
    Faulting application path: D:\Personal\TrainingCode\elec-edge\electron-q\node_modules\electron\dist\electron.exe
    Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
    Report Id: 53e8c650-6ca6-4bfa-afca-afb9300dbc24
    Faulting package full name: 
    Faulting package-relative application ID: 
  11. The crash happen when I require electron-edge. So it is not something with the javascript code I was using to refer to the dll. Please note I'm also confused how to refer to core dll in the javascript code as well. e.g You map a method in a core dll to a javascript function. Should it be static method or method with special signature like you do in inline c# code?

Please let me know if there is anything wrong with my steps referring my own core dll with edge. If you have a complete working sample it is much appreciated.

CzBuCHi commented 7 years ago

i tried to create sample project for last 5 hours .... and failed :( ... see electron-edge-netcore

my guess, why it isnt worknig is because edge custom compilation fails with this error:

     Creating library c:\projects\cstech\xx\node_modules\electron-edge\build\Debug\edge_nativeclr.lib and object c:\projects\cstech\xx\node_modules\electron-edge\build\Debug\edge_nativeclr.exp
edge.obj : error LNK2020: unresolved token (0A000651) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
v8synchronizationcontext.obj : error LNK2020: unresolved token (0A000654) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clractioncontext.obj : error LNK2020: unresolved token (0A000652) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfuncreflectionwrap.obj : error LNK2020: unresolved token (0A00064B) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
persistentdisposecontext.obj : error LNK2020: unresolved token (0A000653) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
nodejsfuncinvokecontext.obj : error LNK2020: unresolved token (0A000667) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
nodejsfunc.obj : error LNK2020: unresolved token (0A000653) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfuncinvokecontext.obj : error LNK2020: unresolved token (0A00065B) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfunc.obj : error LNK2020: unresolved token (0A00069C) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
utils.obj : error LNK2020: unresolved token (0A000651) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
edge.obj : error LNK2028: unresolved token (0A000772) "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@$$FYAPEAX_K0_N@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
v8synchronizationcontext.obj : error LNK2028: unresolved token (0A000776) "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@$$FYAPEAX_K0_N@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clractioncontext.obj : error LNK2028: unresolved token (0A000776) "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@$$FYAPEAX_K0_N@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfuncreflectionwrap.obj : error LNK2028: unresolved token (0A000771) "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@$$FYAPEAX_K0_N@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
persistentdisposecontext.obj : error LNK2028: unresolved token (0A000775) "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@$$FYAPEAX_K0_N@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
nodejsfuncinvokecontext.obj : error LNK2028: unresolved token (0A00079B) "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@$$FYAPEAX_K0_N@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
nodejsfunc.obj : error LNK2028: unresolved token (0A00077E) "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@$$FYAPEAX_K0_N@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfuncinvokecontext.obj : error LNK2028: unresolved token (0A00078D) "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@$$FYAPEAX_K0_N@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfunc.obj : error LNK2028: unresolved token (0A00080C) "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@$$FYAPEAX_K0_N@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
utils.obj : error LNK2028: unresolved token (0A000775) "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@$$FYAPEAX_K0_N@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
edge.obj : error LNK2020: unresolved token (0A000859) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
v8synchronizationcontext.obj : error LNK2020: unresolved token (0A00085E) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clractioncontext.obj : error LNK2020: unresolved token (0A00085D) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfuncreflectionwrap.obj : error LNK2020: unresolved token (0A000858) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
persistentdisposecontext.obj : error LNK2020: unresolved token (0A00085C) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
nodejsfuncinvokecontext.obj : error LNK2020: unresolved token (0A000885) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
nodejsfunc.obj : error LNK2020: unresolved token (0A000866) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfuncinvokecontext.obj : error LNK2020: unresolved token (0A000877) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfunc.obj : error LNK2020: unresolved token (0A000909) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
utils.obj : error LNK2020: unresolved token (0A00085E) "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
v8synchronizationcontext.obj : error LNK2001: unresolved external symbol "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
edge.obj : error LNK2001: unresolved external symbol "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
nodejsfuncinvokecontext.obj : error LNK2001: unresolved external symbol "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
persistentdisposecontext.obj : error LNK2001: unresolved external symbol "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfuncreflectionwrap.obj : error LNK2001: unresolved external symbol "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clractioncontext.obj : error LNK2001: unresolved external symbol "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
utils.obj : error LNK2001: unresolved external symbol "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfunc.obj : error LNK2001: unresolved external symbol "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfuncinvokecontext.obj : error LNK2001: unresolved external symbol "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
nodejsfunc.obj : error LNK2001: unresolved external symbol "extern "C" int __cdecl _CrtDbgReportW(int,wchar_t const *,int,wchar_t const *,wchar_t const *,...)" (?_CrtDbgReportW@@$$J0YAHHPEB_WH00ZZ) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
v8synchronizationcontext.obj : error LNK2019: unresolved external symbol "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) referenced in function "void * __cdecl std::_Allocate(unsigned __int64,unsigned __int64,bool)" (?_Allocate@std@@$$FYAPEAX_K0_N@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
edge.obj : error LNK2001: unresolved external symbol "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
nodejsfuncinvokecontext.obj : error LNK2001: unresolved external symbol "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
persistentdisposecontext.obj : error LNK2001: unresolved external symbol "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfuncreflectionwrap.obj : error LNK2001: unresolved external symbol "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clractioncontext.obj : error LNK2001: unresolved external symbol "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
utils.obj : error LNK2001: unresolved external symbol "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfunc.obj : error LNK2001: unresolved external symbol "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
clrfuncinvokecontext.obj : error LNK2001: unresolved external symbol "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
nodejsfunc.obj : error LNK2001: unresolved external symbol "extern "C" void __cdecl _invalid_parameter(wchar_t const *,wchar_t const *,wchar_t const *,unsigned int,unsigned __int64)" (?_invalid_parameter@@$$J0YAXPEB_W00I_K@Z) [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
c:\projects\cstech\xx\node_modules\electron-edge\build\Debug\edge_nativeclr.node : fatal error LNK1120: 32 unresolved externals [c:\projects\cstech\xx\node_modules\electron-edge\build\edge_nativeclr.vcxproj]
  edge_coreclr.vcxproj -> c:\projects\cstech\xx\node_modules\electron-edge\build\Debug\\edge_coreclr.node
  edge_coreclr.vcxproj -> c:\projects\cstech\xx\node_modules\electron-edge\build\Debug\edge_coreclr.pdb (Full PDB)

im not trying to understand that - not c++ developer ... looks like something not referenced?

i welcome any kick in butt right direction to fix it...

weliwita commented 7 years ago

@CzBuCHi Hi, Frankly I haven't checked your example. But it looks similar to the issue I was resolved using step 2 above. Electron edge was compiled and working fine against 1.0.0-preview2-003121 You may try installing that version and point your sample to that version using a global.json file. But I couldn't get it to work referencing external core dll.

CzBuCHi commented 7 years ago

@weliwita I didnt have installed c++ compiler in visual studio 2017 and thats why i got these unresolved symbols .... after that edge compiles file (only warnings)

Tried basic ES5 'Hello world' example, and in .net 4 works fine, but in .net core it throws edge.initializeClrFunc is not a function again :( - in my case object 'edge' has no own members ...

i think i just wait a while and see ...

weliwita commented 7 years ago

Ok, One step further. I was able to get away with referencing core dlls issue. I removed edge.js dependency and referenced the dll as follows. project.json

{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable",
    "emitEntryPoint": true
  },
  "dependencies": {},
  "frameworks": {
    "netcoreapp1.0": {
      "dependencies": {
        "Microsoft.NETCore.App": {
          "type": "platform",
          "version": "1.0.0"
        }
      },
      "imports": "dnxcore50"
    }
  }
}

Map js function to the external dll

var helloWorld = edge.func({
  assemblyFile: path.join(__dirname, 'path-to-dll\\bin\\Debug\\netcoreapp1.0\\dotnets.dll'),
  typeName: 'Startup'
});

My Startup class in dotnets.dll looks like follows.

Startup.cs

using System.Threading.Tasks;

public class Startup
{
    public async Task<object> Invoke(object input)
    {
        return "Hello from core";
    }
}

I will try to add a git hub link as soon as I can assemble this to properly.

weliwita commented 7 years ago

@CzBuCHi ok I agree with you. If you don't want to downgrade to a preview version of dotnet core, I think you should wait for someone from this project to respond.

weliwita commented 7 years ago

Link to my sample repo - https://github.com/weliwita/electron-edge-sample