Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/330.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用edge在Node.js中组装.NET dll_C#_.net_Node.js_Dll_Edge.js - Fatal编程技术网

C# 使用edge在Node.js中组装.NET dll

C# 使用edge在Node.js中组装.NET dll,c#,.net,node.js,dll,edge.js,C#,.net,Node.js,Dll,Edge.js,我不太熟悉dll或.NET。我正在尝试使用节点运行dll库。我正在使用。基本上,我有一个带有几个dll文件的bin/Debug目录。我正在循环遍历这些文件,并试图将它们组装起来,以便从dll中运行一些方法 const edge = require('edge-js') const dllPath = './somePath/bin/Debug/' const fs = require('fs') const path = require('path') let obj = {} fs.read

我不太熟悉dll或.NET。我正在尝试使用节点运行dll库。我正在使用。基本上,我有一个带有几个dll文件的bin/Debug目录。我正在循环遍历这些文件,并试图将它们组装起来,以便从dll中运行一些方法

const edge = require('edge-js')
const dllPath = './somePath/bin/Debug/'
const fs = require('fs')
const path = require('path')
let obj = {}

fs.readdir(dllPath, [], (err, files) => {

  files.forEach((file) => {
    if(file.match(/^(.*\.dll$).*$/)) {

      obj[file.match(/(.*)\.[^.]+$/)[1]] = edge.func({
        assemblyFile: path.join(__dirname, dllPath, file)
      })
    } 
  })
})
但是,edge会不断抛出以下错误:

Could not load type 'CommandLine.Startup' from assembly 'CommandLine, Version=1.9.71.2, Culture=neutral, PublicKeyToken=de6f01bd326f8c32'
我理解,如果我在
edge.func({assemblyFile:'someFile',typeName:'})中不指定类型名,
edge将通过假定名为Startup的类来构造类型名。但是,我不知道类型名是什么,也不知道如何找到它。此外,如何在每个文件中找到方法


感谢您的帮助。谢谢

您可以在Visual Studio中使用对象浏览器浏览DLL,也可以使用ildasm/DotPeek/.NET Reflector对其进行反编译。这些库是什么?您确定他们有任何代码可以作为边缘/节点的入口点吗?您想做什么?您只能访问DLL中的公共方法,并且请注意,您必须通过它们的名称空间访问它们,而名称空间可能与它们的程序集名称不匹配@罗摩库有最好的建议;反编译DLL并探索BIT,我认为类型名只是“string”、“int”等。所以我猜edge要求您尝试调用的方法的返回类型?