Closed as not planned
Description
Describe the bug
When using UnmanagedCallersOnlyAttribute to export a function into a native library on x86 platforms if the function uses stdcall then the name is not properly mangled.
To Reproduce
internal static class NameMangling
{
[UnmanagedCallersOnly(EntryPoint = "TestNameMangling", CallConvs = new Type[] { typeof(CallConvStdcall) })]
public static unsafe int TestNameMangling(void* name, int* id)
{
return 0;
}
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<OutputType>Library</OutputType>
<PublishAot>true</PublishAot>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<StripSymbols>true</StripSymbols>
</PropertyGroup>
Further technical details
Its expected that when publishing with dotnet publish -r win-x86 --self-contained
then using dependencies gui to inspect the published dll that you should see both
TestNameMangling exported
as well
as _TestNameMangling@8 exported.
Without this export any native assembly that load this assembly at runtime will have issues with loading this function pointer.
Metadata
Metadata
Assignees
Type
Projects
Status
No status