I was wondering if someone has ran into this problem as I have tried everything to fix. I have a DevOps build pipeline in Azure running visual studio 2015 version (which matches my local machine) and I am running into this error

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

It builds perfectly fine on my machine. I have no idea why I cannot get this to build fine on DevOps.. and I haven't seen many questions about it. I went ahead and changed the vb.proj file to reflect the following and it still did not work

    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
    <!--Add the below line to fix the project loading in VS 2017 -->
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
    <!--End -->
  <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />```

  • I've been battling this for months on end with no real results - especially on the build server. Recently we went from TFS2013 to DevOps 2020; exact same error. You are on the correct path. Its something with those import tags.
    – Christian
    Commented Nov 26, 2020 at 7:53
  • ideas: stackoverflow.com/questions/3980909/…
    – aloisdg
    Commented Jan 4, 2021 at 17:04

1 Answer 1


It is possible that your project is referring to VS 2017 somewhere. Double-check all your solution and proj files for any reference to VS 2017.

Try to enable debug mode and gather more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.