Error when compiling as a CLR library when importing dll from Edge.js

0

I tried using Edge.js for using .Net library with Node.js. I was able to use one of dll's successfully but for one of my other dll I get below error. Same error for every modification. Code is

input = {
    template:
      'C:\\Test1.docx',
    test: 'C:\\Test2.docx'
  };
  var Comparision = edge.func(function(){/*
    #r "C:\\abc\\Testdll.dll"
    using Testdll;

    async(dynamic data)  => {
      var Comparison = new Comparison();
      return Comparison.Word((string) data.template, (string) data.test);
    }
  */});

Comparison(input, function(error, result) {
    if (error) throw error;
    console.log(result);
  });

Error is

Error: Unable to compile C# code.
----> Errors when compiling as a CLR library:
c:\Users\..\AppData\Local\Temp\pfdlkdvp.0.cs(4,6) : error CS0116: A namespace cannot directly contain members such as fields or methods
c:\Users\..\AppData\Local\Temp\pfdlkdvp.0.cs(13,6) : error CS1022: Type or namespace definition, or end-of-file expected
----> Errors when compiling as a CLR async lambda expression:
c:\Users\..\AppData\Local\Temp\zy0qaogb.0.cs(9,7) : error CS1513: } expected
c:\Users\..\AppData\Local\Temp\zy0qaogb.0.cs(21,9) : error CS0116: A namespace cannot directly contain members such as fields or methods
c:\Users\..\AppData\Local\Temp\zy0qaogb.0.cs(22,5) : error CS1022: Type or namespace definition, or end-of-file expected
c:\Users\..\AppData\Local\Temp\zy0qaogb.0.cs(10,23) : error CS0542: 'Startup': member names cannot be the same as their enclosing type

Tried wrapping this dll with another, which worked fine when tested using .NetWindows App but throws below error using Edge.js

Could not load file or assembly 'Testdll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Invalid pointer (Exception from HRESULT: 0x80004003 (E_POINTER))

Can someone help. Thanks

edge.js
asked on Stack Overflow Jan 8, 2021 by Amrin • edited Jan 8, 2021 by pawello2222

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0