Loading ...

Microsoft.WebApplication.targets was not found | CodeAsp.Net

Microsoft.WebApplication.targets was not found

0 (0votes)

I was getting the following error while building my solution with VS2019 tools for msbuild

The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" was not found. Also, tried to find "WebApplications\Microsoft.WebApplication.targets" in the fallback search path(s) for $(VSToolsPath) - "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v16.0" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\MSBuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.


I noticed that the following path was not having the WebApplications folder:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0


The solution was to install ASP.NET and web development package in VS2019 installer.


When the installation was completed, the WebApplications folder was created at the following path:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\WebApplications

I was able to run the msbuild process successfully after that.

Comments (no comments yet)

Top Posts