Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support LibraryImport with non-C# languages #98265

Open
@DemiMarie

Description

@DemiMarie

DllImport is no longer recommended as it is unfriendly to tree shaking and requires extra runtime support. The replacement is LibraryImport, but that requires a source generator that is only available to C#. Therefore, languages like F# do not support it, and it is not clear how they should support it.

This is a request to document what the actual tree-shaking-friendly runtime primitive is, so that source language compilers know what code they need to emit. This is a prerequisite for tree-shaking-friendly FFI in languages other than C#.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions