I'm trying to deploy my Sitecore 9.1 solution to Azure DevOps. I'm using a Hosted VS2017 Agent pool to do that.

When it compiles my *.sln solution, an error shows up, explaining that WebApplication.targets is not found. How can I find this location on the Hosted Agent ?

Error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found.

It seems that MSBuild tools are not installed on the distant machine.

This is a glance on my azure devops build task :

Configuration of my Visual Studio build

  • Take a look here -> stackoverflow.com/a/12975170/772898 – Peter Procházka May 16 '19 at 9:49
  • I've already looked at this post but it doesn't answer my problem because mine is located on Azure Hosted agent. I cannot install anything or modify its content. I need to reach the right URL for the project, which I don't know... – Thomas GRIESMAR May 16 '19 at 9:52
  • Take a look in that precise answer. It will enable you to use that in Azure DevOps just by copying BuildTargets into your solution – Peter Procházka May 16 '19 at 9:54
  • By copying BuildTargets into your solution may cause issues in a near future, I have being there a couple weeks ago. You have to install Visual Studio 2017 Build Tools on your agent using the following options Microsoft.VisualStudio.Component.NuGet.BuildTools, Microsoft.VisualStudio.Workload.WebBuildTools – Vinicius Deschamps May 16 '19 at 10:01
  • Ok @ViniciusDeschamps but how can I install this Nuget Package ? Should I restore a nuget package with a specific task in my pipeline ? Or should I install it directly in my solution and reference it in each project ? – Thomas GRIESMAR May 16 '19 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.