I tried to create portable class library using F# which could be used for example from C# code. But looks like using standard F# constructs, like raise
makes FSharp.Core.dll necessary to use created Portable Class Library.
raise(ArgumentNullException("parameter"))
is transformed into
Operators.Raise<Unit>(new ArgumentNullException("source"));
(where Operators.Raise
lives in Microsoft.FSharp.Core
namespace) instead of just
throw new Exception
I assume that's not the only F# construct which is compiled to some static method from FSharp.Core.dll library.
Is there any way to create F# code (especially Portable Class Library) which after compilation does not require a reference to FSharp.Core.dll or any other FSharp-specific library?
If you compile the code with
--standalone
the compiler will do an equivalent of static linking. As a result, the references won't be needed at run time.
This is probably the best you can do.
Ideally you would be referencing a portable version of FSharp.Core that have been built against a certain profile, rather than statically linking everything.
I think there are portable versions of profile 47, 88, and 158.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With