Mar*_*zek 12 c# f# portable-class-library
我尝试使用F#创建可移植类库,例如可以使用C#代码.不过貌似使用标准的F#构造,就像raise让FSharp.Core.dll需要使用便携式创建类库.
raise(ArgumentNullException("parameter")) 变成了
Operators.Raise<Unit>(new ArgumentNullException("source"));
Run Code Online (Sandbox Code Playgroud)
(Operators.Raise住在Microsoft.FSharp.Core命名空间中)而不仅仅是
throw new Exception
Run Code Online (Sandbox Code Playgroud)
我假设这不是唯一从FSharp.Core.dll库编译为某个静态方法的F#构造.
有没有办法创建F#代码(特别是可移植类库),在编译后不需要引用FSharp.Core.dll或任何其他FSharp特定的库?
Joh*_*mer 14
如果您使用编译代码
--standalone
Run Code Online (Sandbox Code Playgroud)
编译器将执行等效的静态链接.因此,在运行时不需要引用.
这可能是你能做的最好的.