Answers: <p>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.</p>
  <p>Try to enable debug mode and gather more info.</p>
  
Answers: CC BY-SA 4.0
Answers: 2023-10-25T16:22:13.807Z
Answers: 2023-10-25T19:00:48.627Z
Answers: 2023-10-25T19:00:48.627Z
Answers: geeky_girl
Body: <p>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</p>
  
  <p><strong>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</strong></p>
  
  <p>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 </p>
  
  <pre><code>    &lt;VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''"&gt;14.0&lt;/VisualStudioVersion&gt;
      &lt;!--Add the below line to fix the project loading in VS 2017 --&gt;
      &lt;VSToolsPath Condition="'$(VSToolsPath)' == ''"&gt;$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)&lt;/VSToolsPath&gt;
      &lt;!--End --&gt;
    &lt;/PropertyGroup&gt;
    &lt;Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" /&gt;
    &lt;Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /&gt;
    &lt;Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /&gt;```
  
  </code></pre>
  
Comments: CC BY-SA 4.0
Comments: 2020-11-26T07:53:05.767Z
Comments: 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.
Comments: Christian
Comments: CC BY-SA 4.0
Comments: 2021-01-04T17:04:05.387Z
Comments: ideas: https://stackoverflow.com/questions/3980909/microsoft-webapplication-targets-was-not-found-on-the-build-server-whats-your
Comments: aloisdg
Tags: <azure-devops><azure><azure-pipelines>
Title: Error MSB4226: Microsoft.WebApplication.targets" was not found
UserDisplayName: ThatDevOpsGuy
ThreadText: # Error MSB4226: Microsoft.WebApplication.targets" was not found
  
  (Asked by: username_0 on 2020-06-01)
  
  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 -->
    </PropertyGroup>
    <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" />```
  
  ```
  
  **Tags:** azure-devops, azure, azure-pipelines
  
  > **Comments:**
  > **username_1**: 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.  
  > **username_2**: ideas: https://stackoverflow.com/questions/3980909/microsoft-webapplication-targets-was-not-found-on-the-build-server-whats-your  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2023-10-25. Score: 0
  
  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.
  
  
  ---
  
  