Web Deploy 3.0 won't work on CI server
Asked Answered
M

1

4

From my local machine to a development server, Web Deploy 3.0 works fine with Visual Studio 2012 publish profiles using the following command:

msbuild .\myproj.csproj /verbosity:d /p:DeployOnBuild=true;PublishProfile=Develop;VisualStudioVersion=11.0;AllowUntrustedCertificate=true;username=xx;password=xx

When running this same command from the CI server (happens to be Jenkins but this should apply to any), the command finishes successfully, but no web site is ever deployed.

When comparing the log output, a large section appears to be skipped by the build server. It is occuring just after the 2 lines listed below (these 2 lines of output are identical when running local or on the CI server):

Target "PrepareForRun" in file "C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets" from project "C:_Application\proj\src\proj.Web\proj.Web.csproj" (target "CoreBuild" depends on it): Done building target "PrepareForRun" in project "proj.Web.csproj".

When running locally, this is followed up by what is shown below (plus hundreds more lines of logging):

Target "InsertAdditionalWebCofigConnectionStrings" skipped, due to false condition; ($(InsertAdditionalWebCofigConnectionStrings) And '@(_ConnectionStringsToInsert)' != '') was evaluated as (True And '' != ''). Target "_CleanWPPIfNeedTo" in file "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets" from project "C:_Application\proj\src\proj.Web\proj.Web.csproj" (target "PipelineCollectFilesPhase" depends on it): Task "ReadLinesFromFile"

On the CI server, this directory appears to be missing:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets

Would a missing targets cause it to fail silently? Where does this folder come from (missing the entire Web folder on the CI server)?

Maroon answered 20/3, 2013 at 16:53 Comment(0)
N
4

Have you installed Visual Studio on your build server? It seems like a strange thing to do at first (and isn't strictly necessary), but it certainly in the easiest way to resolve all these issues.

You can manually copy the required targets files from your PC on to the build server, but you'll be playing a trial and error game to get it to work.

Also if MS release new out of band updates, like Asp.Net and Web Tool 2012.2 which they did recently, it's a much easier install procedure for the build server than to try and work out what targets have changed and copy them up manually.

Let me know if this helps.

Nubianubian answered 21/3, 2013 at 9:4 Comment(3)
VS was already installed on the build server, but was still missing the "Web" folder. I manually copied all the files in "Web" to the build server and it worked fine.Maroon
Which SKU of VS was installed. I think i'm right in saying that in order to get the Web targets, you need to have the Web Developer SKU installed.Nubianubian
+11. After 48 hours of Google-foo, this answer finally got my Jenkins instance to quit silently bypassing the deployment step. Thanks!Notary

© 2022 - 2024 — McMap. All rights reserved.