microsoft / node-api-dotnet

Advanced interoperability between .NET and JavaScript in the same process.
MIT License
484 stars 52 forks source link

Method not found 'Boolean Microsoft.JavaScript.NodeApi.JSValue.Is()' #364

Closed moriyalb closed 1 week ago

moriyalb commented 2 weeks ago

//JSValue.cs public bool Is<T>() where T : struct, IJSValue<T> { return T.CanCreateFrom(this); }

//MyCode //JSValue _in; if (!_in.Is<JSMap>()) { Jex.Error("implicit map value failed. invalid value "); return _out; }

Compile is success. But while running, got this error:

Error: Method not found: 'Boolean Microsoft.JavaScript.NodeApi.JSValue.Is()'. at jj.Jex.Runtime.ProxyTypes.Tb5b61cd4_W.op_Implicit(JSValue _in) How could this happen?
jasongin commented 2 weeks ago

I'm not sure what's going on there. Is it possible it's using an older version of the assembly at runtime than the one used to build? The JSValue.Is<>() method was added fairly recently so a slightly older version wouldn't have it.

jasongin commented 1 week ago

Closing because I can't reproduce this. Try doing a clean build, and check the version of the Microsoft.JavaScript.NodeApi assembly in your output directory.