F# / FAKE - How to specify `--platform:x64` when invoking MSBuild

Viewed 214

I am very new to FAKE. I use the following code (based on the official FAKE example) to build some F# project:

Target.create "BuildApp" (fun _ ->
  [ p.buildTarget ]
    |> MSBuild.runRelease id buildDir "Build"
    |> Trace.logItems "AppBuild-Output: "
)

Everything is great except that it builds a 32-bit application, while I explicitly need a 64-bit one (with <gcAllowVeryLargeObjects enabled="true" />, of course) as otherwise it would not make a dent. This answer: FAKE: How to define MSBuild properties? seems to reference FAKE 4 but it looks that I have FAKE 5.

How can I tell FAKE 5 to build a 64-bit application? Thanks a lot!

1 Answers

You can set properties by supplying a setParams function other than id to MSBuild.runRelease:

Target.create "BuildApp" (fun _ ->
  [ p.buildTarget ]
    |> MSBuild.runRelease (fun p ->
        { p with Properties = [ "platform", "x64" ] } ) buildDir "Build"
    |> Trace.logItems "AppBuild-Output: "
Related