找不到 Nlog 或其依赖项之一 - edge-js
Could not find Nlog or one of its dependancies - edge-js
我正在尝试使用 this DLL through edge-js。当代码只是作为一个简单的 c# 程序构建时,它可以毫无问题地运行。不幸的是,当端口被编码到 edge-js 时,它在 Nlog 上遇到了麻烦,注意到它或它的依赖项找不到。我对我的 C# 不太了解,边缘包对我来说是新的。任何人都可以帮助我理解吗?
节点错误:
{ 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' }
我只需要依赖 dll。我在 edge 中添加并引用了它们,现在它按预期工作了。
我正在尝试使用 this DLL through edge-js。当代码只是作为一个简单的 c# 程序构建时,它可以毫无问题地运行。不幸的是,当端口被编码到 edge-js 时,它在 Nlog 上遇到了麻烦,注意到它或它的依赖项找不到。我对我的 C# 不太了解,边缘包对我来说是新的。任何人都可以帮助我理解吗?
节点错误:
{ 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' }
我只需要依赖 dll。我在 edge 中添加并引用了它们,现在它按预期工作了。