StonesBG
StonesBG

Reputation: 180

Using a specific version of MSBuild in a FAKE build script

I currently have VS2013 and VS2015 installed on my machine.

By default FAKE F# Make seems to be building with VS2015.

I tried passing into my MSBuild task the VisualStudioVersion 12.0 but that didn't seem to have any effect.

I saw some articles say to change the MSBuildPath in the Fake.exe.config but I don't see the MSBuildPath in that exe.

How do I make sure it uses the MSBuild provided with Visual Studio 2012 (12.0)?

Upvotes: 6

Views: 1850

Answers (2)

Ilya Reva
Ilya Reva

Reputation: 1

@Andrew code didn't change MSBuild version for me. I figure out another way do achieve this.

EnvironmentHelper.setBuildParam "VisualStudioVersion" "14.0"

You could also use "12.0" for vs2013 or "15.0" for vs2017. Here is link to Fake source that use this variable during the build.

Upvotes: 0

Andrew
Andrew

Reputation: 412

This code works for me:

    let toolsVersion = "12.0"

    let setParams defaults =
        { defaults with
            ToolsVersion = Some(toolsVersion)
        }

    build setParams solutionPath
        |> DoNothing

Upvotes: 5

Related Questions