在af#application中使用ac#assembly的命名空间?

aje*_*jeh 1 f#

有一个带有公共静态类的ac#assembly Something.它有一个公共静态方法DoSomething(string source, string dest, string file, string arch)

我不知道f#并且商店中没有人知道它了,但是我需要将一个f#项目使用的API替换为c#程序集中的内容.

我想在另一个解决方案的f#项目中使用该方法,并添加了对第一个程序集的\ bin\Debug\Something.exe的引用(是的,它兼作命令行EXE).

然后我添加open Something到需要它的f#单元.一旦.NET版本同步,程序集似乎已加载.

现在我编写了这段代码:

let src = "C:\"
let dst = "D:\"
let file = "readme.txt"
let arch = "E:\"
Something.DoSomething src dst file arch
Run Code Online (Sandbox Code Playgroud)

由于此错误,它不会构建:

Error   2
The member or object constructor 'DoSomething' takes 4 argument(s) but is here given 1.
The required signature is 'Something.DoSomething(source: string, dest: string, ?file: string, ?archive: string) : bool'.
Run Code Online (Sandbox Code Playgroud)

我真的只传递了一个错误地认为我正在通过所有4个的论点吗?

Ree*_*sey 5

您需要将其视为一种tupled方法:

Something.DoSomething (src, dst, file, arch)
Run Code Online (Sandbox Code Playgroud)

这应该允许它正确编译和调用方法.