-
I'm trying to write a UDF for a very old Firebird 2.1.5 database server. I'm testing the UDF with the following function: [UnmanagedCallersOnly(EntryPoint = nameof(TestUdf), CallConvs = new[] { typeof(CallConvCdecl) })]
public static unsafe int TestUdf(int* input)
{
return *input * 2;
} And publishing the native DLL with this command:
However when I try to load the function from Firebird, it fails to find the entry point. If I investigate the generated function with the
I've never seen this weird 'ExportedName = Namespace_Namespace_DllMain__ExportedName' notation, and I believe this is what's causing the issues. It's important to note that I tested the same UDF shortly after .NET 7 was released, on the same Firebird database, and it worked without any issues. I also don't remember seeing this weird exported name format back then. Maybe something was changed in a more recent .NET 7 update? Is there a way to ensure that the exported names appear exactly like they're specified in the C# code, without the '=' sign? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The exported name is |
Beta Was this translation helpful? Give feedback.
The exported name is
TestUdf
(ie it is the name to pass to GetProcAddress Windows API).FirebirdUdf_FirebirdUdf_DllMain__TestUdf
is internal symbol name create by native AOT name mangler, it is not the exported name.