3

I am getting the following error when I am building the solution using continuous integration

[error]Apps\App.Service\App.Service.csproj(203,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\Community\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.

When I check my .csproj I have the following on top <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> so can some one tell me what was the issue

Community
  • 1
  • 1
Developer
  • 8,390
  • 41
  • 129
  • 238
  • What's your project and if it's migrate from vs2015 to vs2017? If you used local private agent to build, please also check the file `Microsoft.Web.Publishing.targets` is exist in C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications`C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\Web`. – Marina Liu Jun 16 '17 at 06:02
  • Hi I am having 4 projects which I am building out of that 1 is executing successfully with `msbuild` but the remaining are failing – Developer Jun 19 '17 at 09:03
  • What's the different settings among the four projects? Or can you share the four projects in one drive? – Marina Liu Jun 19 '17 at 09:33
  • Able to figure out from here https://developercommunity.visualstudio.com/content/problem/31756/msbuild-targets-not-found-for-project-created-in-v.html – Developer Jun 19 '17 at 11:35
  • @DorababuMeka if you were able to resolve this issue, can you please add your solution as an answer? – Ryan Gates Jul 10 '18 at 19:28
  • I didn't remember the solution as I am currently not working on PS but I did some thing from the link I posted – Developer Jul 12 '18 at 11:04

1 Answers1

2

I had the same issue when trying to setup gitlab CI on my project. This answer https://stackoverflow.com/a/20095260/5873231 solved my problem. I leave it here, maybe it's useful for someone.

nnunes10
  • 550
  • 4
  • 14