You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AOT Native Library example does not include any F# code or documentation. Attempting to adapt the example to F# as in the below example causes a compiler error This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect. but I cannot find any mention of this limitation, workarounds, future support date, etc.
It would be superb if someone would be willing to add some or all of the following information to either to this example repo or the official docs or both!
Information which would be super helpful to me and others like me
Whether there is an official mainline way to compile a Native Library from F# in the same way as C# in .NET 7
The backstory to the compiler error and the current outlook for adding UnmanagedCallersOnly support to the F# compiler
Best practices for working around the limitations in the current release of .NET 7 (is it best to use CoreRT despite it being superseded by mainline .NET?)
Thank you for reading!
// My attempt to expose a simple function in a Native Library build.namespaceHelloLibopenSystem.Runtime.InteropServicesmoduleSay =[<UnmanagedCallersOnly(EntryPoint="hello")>]lethello name =
printfn "Hello %s" name
Target framework
Check the .NET target framework(s) being used, and include the version number(s).
.NET Core
.NET Framework
.NET Standard 7.0.102
If using the .NET Core SDK, include dotnet --info output. If using .NET Framework without the .NET Core SDK, include info from Visual Studio's Help > About Microsoft Visual Studio dialog.
dotnet --info output or About VS info
dotnet --info.NET SDK: Version: 7.0.102 Commit: 4bbdd14480Runtime Environment: OS Name: manjaro OS Version: OS Platform: Linux RID: manjaro-x64 Base Path: /usr/share/dotnet/sdk/7.0.102/Host: Version: 7.0.2 Architecture: x64 Commit: d037e070eb.NET SDKs installed: 7.0.102 [/usr/share/dotnet/sdk].NET runtimes installed: Microsoft.NETCore.App 7.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]Other architectures found: NoneEnvironment variables: Not setglobal.json file: Not foundLearn more: https://aka.ms/dotnet/infoDownload .NET: https://aka.ms/dotnet/download
The text was updated successfully, but these errors were encountered:
Issue description
The AOT Native Library example does not include any F# code or documentation. Attempting to adapt the example to F# as in the below example causes a compiler error
This attribute is currently unsupported by the F# compiler. Applying it will not achieve its intended effect.
but I cannot find any mention of this limitation, workarounds, future support date, etc.This is particularly confusing/frustrating because there is this lovely 2+ year old example of doing an F# native library in .NET SDK version 3, but there seems to be little else on the web discussing F# native libraries in more modern .NET.
It would be superb if someone would be willing to add some or all of the following information to either to this example repo or the official docs or both!
Information which would be super helpful to me and others like me
UnmanagedCallersOnly
support to the F# compilerThank you for reading!
Target framework
Check the .NET target framework(s) being used, and include the version number(s).
If using the .NET Core SDK, include
dotnet --info
output. If using .NET Framework without the .NET Core SDK, include info from Visual Studio's Help > About Microsoft Visual Studio dialog.dotnet --info output or About VS info
The text was updated successfully, but these errors were encountered: