मेरे पास निम्नलिखित सी # कोड है।एफ # से सी # ऑब्जेक्ट का उपयोग कैसे करें?
namespace MyMath {
public class Arith {
public Arith() {}
public int Add(int x, int y) {
return x + y;
}
}
}
और मैं एफ # testcs.fs इस वस्तु का उपयोग करने के नाम पर रखा गया कोड के साथ आया था।
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 पर्यावरण के लिए मोनो का इस्तेमाल किया।
यह ठीक काम करता है। धन्यवाद। – prosseek