Azure DevOps Pipelines cannot find project file path due to $(SolutionDir) macros on Git submodules.
I run the build task below for Solution1.sln, this solution includes several projects checked out from Git submodules.
One of these Git submodules is a solution (Solution2.sln) which also has its own projects checked out from Git submodules.
When MSBuild task runs against Solution2.sln, it cannot find the project file paths because the project files (.csproj) use $(SolutionDir) which works fine locally since Visual Studio knows $(SolutionDir) = Solution2.sln path.
However, in Azure DevOps, MSBuild thinks $(SolutionDir) is Solution1.sln path.
How can I force MSBuild in Azure DevOps to respect the $(SolutionDir) macro respective to the solution that is currently building (Solution2.sln), not the solution that is passed as task input (Solution1.sln)?
steps:
- checkout: self
submodules: recursive
persistCredentials: true
- task: VSBuild@1
inputs:
solution: 'Solution1.sln'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(Build.ArtifactStagingDirectory)"'
platform: 'Any CPU'
configuration: 'Release'