Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

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

Open
weliwita opened this issue May 26, 2017 · 6 comments
Open

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

weliwita opened this issue May 26, 2017 · 6 comments

Comments

@weliwita
Copy link

I found this thread useful in this regard. tjanczuk#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"
  }
}
  1. Install electron-edge npm install electron-edge
  2. Ran helloworld sample. Working fine with dot net framework.
  3. set EDGE_USE_CORECLR=1
  4. Ran helloworld sample. Working fine with core clr.
  5. Create new dotnet core class library project with same sdk version 1.0.0-preview2-003121
  6. 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"
      }
    }
  }
}
  1. With dotnet restore and dotnet build created deps file and the dll
  2. 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: 
  1. 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
Copy link

CzBuCHi commented May 26, 2017

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
Copy link
Author

@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
Copy link

CzBuCHi commented May 29, 2017

@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
Copy link
Author

weliwita commented May 29, 2017

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
Copy link
Author

@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
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants