2
votes

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

1
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\WebApplicationsC:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\Web.Marina Liu
Hi I am having 4 projects which I am building out of that 1 is executing successfully with msbuild but the remaining are failingDeveloper
What's the different settings among the four projects? Or can you share the four projects in one drive?Marina Liu
@DorababuMeka if you were able to resolve this issue, can you please add your solution as an answer?Ryan Gates

1 Answers

0
votes

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.