0
votes

my project fails to build because it cant reach Microsoft.Web.Publishing.targets on Azure DevOps

Our VStoolsPath on Prem is 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0' and with '\Web\Microsoft.WebSite.Publishing.targets' is able to build.

I was wondering how do we find out what is the VStoolsPath for AzureDevOps? how do we find the same/similar path to get to Microsoft.WebSite.Publishing.targets to allow us to build our code?

Our csproj file is configured like this:

<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" 
        Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

<Import Project="$(VSToolsPath)\Web\Microsoft.Web.Publishing.targets" 
        Condition="'$(VSToolsPath)' != ''" />

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.targets" 
        Condition="false" />

This is the error I am getting:

src\Licensing and Registry\Wapol.LnR.Automation.Agent\Wapol.LnR.Automation.Agent.csproj(4,11): Error MSB4226: The imported project "$(VSToolsPath)\Web\Microsoft.Web.Publishing.targets" was not found.

Also, tried to find "$(VSToolsPath)\Web\Microsoft.Web.Publishing.targets" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0" .

These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin\msbuild.exe.Config". Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths. Process 'msbuild.exe' exited with code '1'.

1

1 Answers

0
votes

Whoops, found out I was using an incorrect agent to build.

Had to go to Agent pipeline - Azure Pipeline, then agent specification is set to 'vs2015-win2012r2'