tjanczuk / edge

Run .NET and Node.js code in-process on Windows, MacOS, and Linux
http://tjanczuk.github.io/edge
Other
5.42k stars 641 forks source link

Crashing when calling Process.GetCurrentProcess().MainModule.FileName() #721

Closed bmart102 closed 5 months ago

bmart102 commented 3 years ago

I have c# dll (NET 5.0) and when calling System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName, it crashes with errors below:

undefined:1 (function (f, ctx) { return function (d, cb) { return f(d, cb, ctx); }; }) ^ Waiting for the debugger to disconnect... Error: Method not found: 'System.Collections.ArrayList System.Collections.ReadOnlyCollectionBase.get_InnerList()'. at :1:55 at Object. (C:\Users\brix\source\repos\QAToolsNodeJs2\main.js:19:1)
at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 { Message: "Method not found: 'System.Collections.ArrayList System.Collections.ReadOnlyCollectionBase.get_InnerList()'.", TargetSite: { Name: '', DeclaringType: '', ReflectedType: '', MemberType: '', MetadataToken: '', Module: '', IsSecurityCritical: '', IsSecuritySafeCritical: '', IsSecurityTransparent: '', MethodHandle: '', Attributes: '', CallingConvention: '', ReturnType: '', ReturnTypeCustomAttributes: '', ReturnParameter: '', IsCollectible: '', IsGenericMethod: '', IsGenericMethodDefinition: '', ContainsGenericParameters: '', MethodImplementationFlags: '', IsAbstract: '', IsConstructor: '', IsFinal: '', IsHideBySig: '', IsSpecialName: '', IsStatic: '', IsVirtual: '', IsAssembly: '', IsFamily: '', IsFamilyAndAssembly: '', IsFamilyOrAssembly: '', IsPrivate: '', IsPublic: '', IsConstructedGenericMethod: '', CustomAttributes: '' }, StackTrace: ' at System.Diagnostics.NtProcessManager.GetModules(Int32 processId, Boolean firstModuleOnly)\r\n' + ' at System.Diagnostics.NtProcessManager.GetFirstModule(Int32 processId)\r\n' + ' at System.Diagnostics.Process.get_MainModule()\r\n' + ' at ClassLibrary7.Class7.Invoke(Object input)', Data: {}, InnerException: null, HelpLink: null, Source: 'System.Diagnostics.Process', HResult: -2146233069, Name: 'System.MissingMethodException', name: 'System.MissingMethodException' }

agracio commented 5 months ago

If it still a relevant issue follow up at https://github.com/agracio/edge-js