Could not find Nlog or one of its dependancies - edge-js

0

I'm trying to use this DLL through edge-js. When the code is built as just a simple c# program, it works without any issues. Unfortunately, when the port is coded over to edge-js it has trouble with Nlog, noting that it or its dependancies can't be found. I'm not too knowledgable on my C# and the edge package is new to me. Can anyone help me understand?

The node error:

{ Error: The type initializer for 'Sharlayan.MemoryHandler' threw an exception.
    at <anonymous>:1:55
    at Object.<anonymous> (D:\Work\SharlayanNode\index.js:65:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
  TypeName: 'Sharlayan.MemoryHandler',
  Message:
   'The type initializer for \'Sharlayan.MemoryHandler\' threw an exception.',
  Data: {},
  InnerException:
   { Error: Could not load file or assembly 'NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c' or  pointer (Exception from HRESULT: 0x80004003 (E_POINTER))
       at <anonymous>:1:55
       at Object.<anonymous> (D:\SharlayanNode\index.js:65:1)
       at Module._compile (internal/modules/cjs/loader.js:689:30)
       at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
       at Module.load (internal/modules/cjs/loader.js:599:32)
       at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
       at Function.Module._load (internal/modules/cjs/loader.js:530:3)
       at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
       at startup (internal/bootstrap/node.js:266:19)
       at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
     Message:
      'Could not load file or assembly \'NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c\' or oneinter (Exception from HRESULT: 0x80004003 (E_POINTER))',
     FileName:
      'NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c',
     FusionLog: '',
     Data: {},
     InnerException:
      { Error: Object reference not set to an instance of an object.
          at <anonymous>:1:55
          at Object.<anonymous> (D:\Work\SharlayanNode\index.js:65:1)
          at Module._compile (internal/modules/cjs/loader.js:689:30)
          at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
          at Module.load (internal/modules/cjs/loader.js:599:32)
          at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
          at Function.Module._load (internal/modules/cjs/loader.js:530:3)
          at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
          at startup (internal/bootstrap/node.js:266:19)
          at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)
        Message: 'Object reference not set to an instance of an object.',
        Data: {},
        InnerException: null,
        TargetSite: {},
        StackTrace:
         '   at EdgeCompiler.CurrentDomain_AssemblyResolve(Object sender, ResolveEventArgs args)\r\n   at System.AppDomaiAssembly assembly, String assemblyFullName)',
        HelpLink: null,
        Source: 'edge-cs',
        HResult: -2147467261,
        message: 'Object reference not set to an instance of an object.',
        name: 'System.NullReferenceException' },
     TargetSite: {},
     StackTrace: '   at Sharlayan.MemoryHandler..cctor()',
     HelpLink: null,
     Source: 'Sharlayan',
     HResult: -2147467261,
     message:
      'Could not load file or assembly \'NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c\' or oneinter (Exception from HRESULT: 0x80004003 (E_POINTER))',
     name: 'System.IO.FileLoadException' },
  TargetSite: {},
  StackTrace:
   '   at Sharlayan.MemoryHandler.get_Instance()\r\n   at Startup.<Invoke>d__1.MoveNext()',
  HelpLink: null,
  Source: 'Sharlayan',
  HResult: -2146233036,
  message:
   'The type initializer for \'Sharlayan.MemoryHandler\' threw an exception.',
  name: 'System.TypeInitializationException' }
c#
node.js
dll
node-modules
nlog
asked on Stack Overflow Jul 14, 2019 by Dan Ruxton

1 Answer

2

All i needed was the dependancy dll's. I added and referenced them in edge and now it's working as intended.

answered on Stack Overflow Jul 15, 2019 by Dan Ruxton

User contributions licensed under CC BY-SA 3.0