2

I am trying to publish a website at our CI server.

For some reason target WebPublish works when building with MSBuild 12.0 but not with MSBuild 14.0.

I can test it with following command: msbuild My.Web.csproj /t:WebPublish It works with 12.0. MSBuild 14.0 gives error: Build FAILED.

R:\My.Web\My.Web.csproj" (WebPublish target) (1) ->
R:\My.Web\My.Web.csproj : error MSB4057: The target "WebPublish" does not exist in the project.

0 Warning(s)
1 Error(s)

I have Visual Studio 2012 and 2015 installed. Is there something else I have to install in the CI server?

Juho Rutila
  • 1,951
  • 21
  • 32

2 Answers2

2

For anyone running into this problem currently, there are some alternative solutions posted on the following stack overflow question

The thing that fixed it for me was the "Web" and "Web Applications" folders found in the MSBuild directory for the version of visual studio that matched what I built my project in. In my case this was

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0

0

You have to install "Web Developer Tools". You can do it from "Programs and Features" and repairing Visual Studio 2015.

Juho Rutila
  • 1,951
  • 21
  • 32