Skip to content

iOS (and other Apple platforms): System.Private.CoreLib.dll has P/Invokes to a libhostpolicy library that isn't shipped #38543

@rolfbjarne

Description

@rolfbjarne

Description

The System.Private.CoreLib.dll has P/Invokes to libhostpolicy:

$ monodis microsoft.netcore.app.runtime.ios-x64/5.0.0-preview.7.20317.2/runtimes/ios-x64/native/System.Private.CoreLib.dll | grep libhostpolicy
.module extern 'libhostpolicy'
    .method assembly static hidebysig pinvokeimpl ("libhostpolicy" as "corehost_resolve_component_dependencies" autochar cdecl )
    .method assembly static hidebysig pinvokeimpl ("libhostpolicy" as "corehost_set_error_writer" autochar cdecl )

But there's no libhostpolicy library in the Microsoft.NETCore.Runtime.ios-x64 nuget (nor are these native functions provided by any other library that I can find).

Other information

It's highly preferable to not have any P/Invokes to native functions that don't exist, because it allows the AOT compiler to generate more efficient code. It also makes other performance improvements possible.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions