Try running this in F # interactive:
#r "System.ServiceModel" #r "System.Runtime.Serialization" open System.ServiceModel [<ServiceContract>] type IWCF = [<OperationContract>] abstract Ping: float -> unit type WCF () = interface IWCF with member o.Ping a = printfn "Hello, %g" a let svh = new ServiceHost (typeof<WCF>)
You are likely to succeed. Try to make a new decision.
Link:
- System.Runtime.Serialization
- System.ServiceModel
Paste the following code in Program.fs
:
open System.ServiceModel [<ServiceContract>] type IWCF = [<OperationContract>] abstract Ping: float -> unit type WCF () = interface IWCF with member o.Ping a = printfn "Hello, %g" a let svh = new ServiceHost (typeof<WCF>)
And run it. I get the following error:
All parameter names used in the operations that make up the service contract must not be null. Parameter Name: Name
What's wrong?
PS: I am using Visual Studio 2010 Ultimate SP1
EDIT: just make sure the C # equivalent works fine
source share