我有以下的C#代码。
namespace MyMath {
public class Arith {
public Arith() {}
public int Add(int x, int y) {
return x + y;
}
}
}
我想出了名为testcs.fs的F#代码来使用这个对象。
open MyMath.Arith
let x = Add(10,20)
当我运行以下命令时:
fsc -r:MyMath.dll testcs.fs
我收到了这个错误信息:
/Users/smcho/Desktop/cs/namespace/testcs.fs(1,13): error FS0039: The namespace 'Arith' is not defined
/Users/smcho/Desktop/cs/namespace/testcs.fs(3,9): error FS0039: The value or constructor 'Add' is not defined
可能出了什么问题? 我在使用针对.NET的mono环境。