intenta ejecutar esto en C# interactivo:F # # interactiva vs solución de F y WCF
#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>)
Es probable que tenga éxito. Intenta hacer una nueva solución.
Referencia:
- System.Runtime.Serialization
- System.ServiceModel
Pegue el código siguiente en 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>)
y ejecutarlo. Me sale el siguiente error:
All parameter names used in operations that make up a service contract must not be null. Parameter name: name
¿Qué pasa?
PS: Yo uso de Visual Studio 2010 Ultimate SP1
EDIT: sólo para asegurarse, el equivalente C# funciona bien
¿Usted ha duplicado a comprobar para asegurarse de que está apuntando a la versión correcta de .NET tiempo de ejecución? Según recuerdo, el valor predeterminado para las aplicaciones de la consola F #, en VS 2010, es el .NET 4 Client Profile, que * no * es el perfil .NET completo, lo que a veces causa este tipo de tipos de "funciona aquí pero no está allí" cuestiones. – pblasucci