Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
emagiz opened this issue Nov 24, 2016 · 5 comments
Open

Comments

@emagiz
Copy link

emagiz commented Nov 24, 2016

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.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;
}
}

@BoDING1007
Copy link

BoDING1007 commented Nov 28, 2016

Looks like I am facing the same issue

@anthonyguertin
Copy link

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

@FairSite2C
Copy link

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

@AleCaste
Copy link

AleCaste commented Mar 4, 2018

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

@jkash20
Copy link

jkash20 commented Apr 29, 2020

Same here :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants