Replies: 1 comment
-
The [LibraryImport("mylib", StringMarshalling = StringMarshalling.Utf16)]
public static partial int run_script_int(string code); #include <emscripten.h>
int run_script_int(char *code)
{
return emscripten_run_script_int(code);
} A whole example of linking native library can be found here https://github.com/dotnet/runtime/tree/main/src/mono/sample/wasm/browser-advanced. Anyway, in case when you want to call into javascript from C#, it's better to use JSImport https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/import-export-interop (example in the same sample). Let me know if you need more information. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I don't know what dllName should be. It always show System.DllNotFoundException in browser console.
Beta Was this translation helpful? Give feedback.
All reactions