I’m just getting started off with F#, so there could be something very simple that I’m missing, but I’m getting a compiler error that no one seems to have run into:
The signature file ‘AsyncSocket’ does not have a corresponding
implementation file. If an implementation file exists then check the
‘module’ and ‘namespace’ declarations in the signature and
implementation files match.
I thought it could be something wrong with my code, so I copied the example from msdn and I’m getting the exact same thing. Any idea what’s happening?
Signature:
namespace Library1
module Module1 =
val function1 : int -> int
type Type1 =
new : unit -> Type1
member method1 : unit -> unit
member method2 : unit -> unit
[<Sealed>]
type Type2 =
new : unit -> Type2
member method1 : unit -> unit
member method2 : unit -> unit
[<Interface>]
type InterfaceType1 =
abstract member method1 : int -> int
abstract member method2 : string -> unit
Implementation:
namespace Library1
module Module1 =
let function1 x = x + 1
type Type1() =
member type1.method1() =
printfn "test1.method1"
member type1.method2() =
printfn "test1.method2"
[<Sealed>]
type Type2() =
member type2.method1() =
printfn "test1.method1"
member type1.method2() =
printfn "test1.method2"
[<Interface>]
type InterfaceType1 =
abstract member method1 : int -> int
abstract member method2 : string -> unit
This error occurs if the signature and implementation files have different names (sans extensions). The signatures and implementations should be in separate files named
<same-name>.fsiand<same-name>.fs, respectively. As pad commented, the signature file should immediately precede the implementation file in the build order (or Solution Explorer treeview).