Closed ShipraRay closed 1 year ago
Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project!
Thanks for reporting, so you know the path to MSBuild on the Azure pipeline but the MSBuild task from FAKE is not picking up that path? If that is the case, could you please provide the path you know so that we can debug it more? And as a workaround, can you try one of these options:
MSBuild
VisualStudioVersion
environment variable, MSBuild task in FAKE try to use the specific MSBuild version, matching that Visual Studio version.Also, the paths that FAKE search for are specified here
In Local machine i have VS2019 installed, and in environment variable i have added MSBuild path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin
And i am able to build the solution.
But in Azure devops pipeline my build is failing(Agent Specification : windows-2019 selected)
In my build.fsx file added this to forcibly take VS 2019 version but still it didnot worked:
let toolsVersion = "Current"
let setParams defaults = { defaults with Verbosity = Some(Quiet) ToolsVersion = Some(toolsVersion) Targets = ["Build"] Properties = [ "Optimize", "True" "DebugSymbols", "True" "Configuration", buildMode ] }
Need some help to fix the pipeline build issue!
Could you please share a complete build script that has the issue, the error message you get from Azure Pipeline, and the path to MSBuild in Azure Pipeline that FAKE is failing to find?
Closing this issue since it is a duplicate of #2703
How can i set build.fsx to pick VS2019 MSBuild toolversion
Repro steps
In my local machine i have VS2019 where the soln.fsx file is building fine(I have set the MSBuild environment path as 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin')
But in Azure Devops pipeline it is failing, i am selecting Agent Specification as windows-2019
Expected behavior
In my sln.fsx file below line:
Fake.DotNet.MSBuild.run is not picking the current VS2019 MSBuild
Actual behavior
How can i make the change in soln.fsx file to pick the VS2019 MSBuild ? so that in Azure Devops pipeline mu build scripts pass when selecting agent windows-2019 (Before we were using agent specification-vs2017-win2016', when the build was successfull but microsoft have deprecated this agent from 2022 onwards). Please help!
Operating system - Windows 10
Version of FAKE - 5.3.0.0
(if performance issue) Performance information, links to performance testing scripts