Using a specific version of MSBuild in a FAKE script assembly

I currently have VS2013 and VS2015 installed on my machine.

By default, FAKE F # Make seems to work with VS2015.

I tried to pass VisualStudioVersion 12.0 into my task MSBuild, but this did not show any effect.

I saw some articles say to modify MSBuildPath in Fake.exe.config, but I do not see MSBuildPath in this exe.

How can I make sure it uses MSBuild with Visual Studio 2012 (12.0)?

+6
source share
2 answers

This code works for me:

let toolsVersion = "12.0" let setParams defaults = { defaults with ToolsVersion = Some(toolsVersion) } build setParams solutionPath |> DoNothing 
+5
source

@ Andrew code has not changed the version of MSBuild for me. I find out that another way to achieve this.

 EnvironmentHelper.setBuildParam "VisualStudioVersion" "14.0" 

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

0
source

Source: https://habr.com/ru/post/981124/


All Articles