edge icon indicating copy to clipboard operation
edge copied to clipboard

Using COM is possible in 0.10.33 but not in 6.9.1 and also not in 4.6.2

Open emagiz opened this issue 7 years ago • 5 comments

Hi,

I tried getting attached code to work in a newer version of nodejs and it seems to fail for a reason I am unable to find out.

It fails with an 'Illegal characters in path.' problem but the real cause might be something else. I don't know. It works without problems in version 0.10.33 of node.

Source code below:

$ node hello-edge.js Load edge native library from: g:\products\postnl-solution\poc-scale\node_modules\edge\lib\native\win32\ia32\4.1.1\edge_nativeclr edge::init V8SynchronizationContext::Initialize V8SynchronizationContext::Unref ClrFunc::Initialize MethodInfo wrapper ClrFunc::Initialize Func<object,Task> wrapper clrFuncProxy ClrFunc::Call instance ClrFuncInvokeContext::ClrFuncInvokeContext ClrFuncInvokeContext::CompleteOnV8Thread ClrFunc::MarshalCLRExceptionToV8 ClrFunc::MarshalCLRObjectToV8 ClrFunc::MarshalCLRObjectToV8 undefined { [System.ArgumentException: Illegal characters in path.] Message: 'Illegal characters in path.', ParamName: null, Data: {}, InnerException: null, TargetSite: {}, StackTrace: ' at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)\r\n at System.Security.Permissions.FileIOPermission.QuickDemand(FileIOPermissionAccess access, String fullPath, Boolean checkForDuplicates, Boolean needFullPath)\r\n at System.IO.FileInfo.Init(String fileName, Boolean checkHost)\r\n at System.IO.FileInfo..ctor(String fileName)\r\n at System.ComponentModel.Design.RuntimeLicenseContext.GetSavedLicenseKey(Type type, Assembly resourceAssembly)\r\n at System.ComponentModel.LicenseManager.LicenseInteropHelper.GetCurrentContextInfo(Int32& fDesignTime, IntPtr& bstrKey, RuntimeTypeHandle rth)\r\n at Startup.<Invoke>d__0.MoveNext() in c:\Users\Bas\AppData\Local\Temp\add7.csx:line 13', HelpLink: null, Source: 'mscorlib', HResult: -2147024809, message: 'Illegal characters in path.', name: 'System.ArgumentException' } ClrFuncInvokeContext::DisposeCallback ClrFuncInvokeContext::CompleteOnV8Thread - async with callback

Bas@BASELZINGA /G/products/postnl-solution/poc-scale (master)

// Overview of edge.js: http://tjanczuk.github.com/edge

var edge = require('edge');

var helloWorld = edge.func({
    source:'add7.csx',
references: ['System.Data.dll', 'Interop.MTLibrary.dll', 'Interop.MTScaleConnectionActiveProj1.dll', 'Interop.MTScaleConnectionServer.dll']});

var sendImpl = function (error, result) {
    console.log(result);
    console.log(error);
};

helloWorld('hoi', sendImpl);

and:

using System;
using System.Data;
using System.Threading.Tasks;
using MTScaleConnectionActiveProj1;

public class Startup
{
public MTScaleConnectionActiveXClass axMTScaleConnectionActiveX1;
private Func<object, Task<object>>  SendImpl { get; set; }

public async Task<object> Invoke(string sendImpl)
{
    axMTScaleConnectionActiveX1 = new MTScaleConnectionActiveXClass();
    axMTScaleConnectionActiveX1.MTDevice = 1;
    axMTScaleConnectionActiveX1.Active = true;

    System.Console.WriteLine(sendImpl);
    return sendImpl;
}
}

emagiz avatar Nov 24 '16 15:11 emagiz

Looks like I am facing the same issue

BoDING1007 avatar Nov 28 '16 10:11 BoDING1007

Please help with this, I have spent several hours trying to understand what I am doing wrong. Seems like something trivial. Thanks

anthonyguertin avatar Feb 28 '17 06:02 anthonyguertin

Maybe include full paths to the dlls and have the paths use / instead of \ . other than that I got no clue.

FairSite2C avatar Mar 19 '17 14:03 FairSite2C

Anyone got a solution for this Illegal characters in path exception issue? We are facing the same problem and have no clue how to fix it

AleCaste avatar Mar 04 '18 19:03 AleCaste

Same here :(

jkash20 avatar Apr 29 '20 06:04 jkash20