문제

I found this function Exec here http://fsharp.github.io/FAKE/apidocs/fake-processhelper-shell.html.

Target "UpdateTools" (fun _ ->
   Exec "cmd"
)

But I keep getting this error, when I try to run it: "The value or constructor 'Exec' is not defined".

I'm new to FAKE and have not used F#, so forgive me if this should be obvious.

Can someone tell me why this api is not accessible like that?

도움이 되었습니까?

해결책

The documentation is documenting class Shell. That means, you need to call it like:

Target "UpdateTools" (fun _ ->
   ignore(Shell.Exec "cmd")
)

or, if you need to work with the error code further:

Target "UpdateTools" (fun _ ->
    let errorCode = Shell.Exec "cmd"
    //do something with the error code
    ()
)

Hope it is a bit clearer now.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top