-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Apologies if this is the incorrect place for this question but I think I'm missing something in how load_assembly_and_get_function_pointer from the hosting example works.
In the hosting example it uses load_assembly_and_get_function_pointer to get a pointer to the C# method: public static int Hello(IntPtr arg, int argLength) which works fine.
In my tests though, I want to just invoke a more simple method: public static void HelloSimple() but I'm unable to get this to work, load_assembly_and_get_function_pointer will return error code (-2147024809 / 0x80070057) - I'm not 100% sure what these error codes relate to. I couldn't find them on https://github.com/dotnet/runtime/blob/main/docs/design/features/host-error-codes.md
I can easily get my methods to invoke if I ensure a parameter is passed and a value is returned. Is this some kind of requirement when invoking C# or perhaps I'm missing some additional code required to allow me to invoke more simple methods?
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
- ID: 83da7030-b5f1-72ad-71f6-424ff45b8b7f
- Version Independent ID: a98926cc-64ab-2911-e4b8-1eaf4573dfe4
- Content: Write a custom .NET runtime host - .NET
- Content Source: docs/core/tutorials/netcore-hosting.md
- Product: dotnet-fundamentals
- GitHub Login: @mjrousos
- Microsoft Alias: tdykstra