如何将 F# 函数转换为非泛型 System.Action?

Bar*_*ski 5 .net c# generics f#

就像标题一样。我有一个现有的 C# 库,我必须使用 F# 互操作访问它。其中一种方法将非通用System.Action委托作为参数。如何将 F# 函数(即unit->unit)转换为该委托?

尝试使用直接转换时,出现以下错误:

Multiple types exist called 'Action', taking different numbers of generic parameters. 
Provide a type instantiation to disambiguate the type resolution, e.g. 'Action<_,_,_,_,_,_,_,_,_>'.
Run Code Online (Sandbox Code Playgroud)