Open
Description
Description
After #100288 still for browser UnmanagedCallersOnly
is not called after publish.
Reproduction Steps
create browser sample app
public unsafe partial class Test
{
public unsafe static int Main(string[] args)
{
UnmanagedFunc();
return 0;
}
[UnmanagedCallersOnly(EntryPoint = "ManagedFunc")]
public static int ManagedFunc(int number)
{
// called from UnmanagedFunc
Console.WriteLine($"ManagedFunc({number}) -> 42");
return 42;
}
[DllImport("local", EntryPoint = "UnmanagedFunc")]
public static extern void UnmanagedFunc(); // calls ManagedFunc
}
and in local.c
#include <stdio.h>
int ManagedFunc(int number);
void UnmanagedFunc()
{
int ret = 0;
printf("UnmanagedFunc calling ManagedFunc\n");
ret = ManagedFunc(123);
printf("ManagedFunc returned %d\n", ret);
}
Expected behavior
ManagedFunc
should be called
Actual behavior
No build errors, in pinvoke-table.h
wrapper is there, but ManagedFunc
is not being called.
Regression?
No response
Known Workarounds
Calling it explicitly
((IntPtr)(delegate* unmanaged<int,int>)&ManagedFunc).ToString();
Configuration
No response
Other information
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status