1

I am trying to publish a vs2013 asp.net webapp (the only project in the solution) on TFS 2012. On any developer box, it downloads, explodes and resolves nuget packages (using nuget 2.8.1,) and runs Web Deploy Publish just fine.

However I am unable to replicate that on the TFS box. MSBuild is not finding nuget packages nor is it running Web Deploy Publish.

1. Nuget

Invoked from csproj

  <PropertyGroup>
    <PreBuildEvent>$(SolutionDir)..\..\..\tools\nuget\nuget.exe restore</PreBuildEvent>
  </PropertyGroup>

as recommended in here. There is no .nuget solution-level directory, nuget.exe and nuget.config live up the tfs folder hierarchy. That works fine on a dev box. Why is it not working on the build server?

2. Web Deploy Publish

msbuild log excerpt:

Run MSBuild for Project
Initial Property Values
...
CommandLineArguments = /p:SkipInvalidConfigurations=true /p:DeployOnBuild=True /p:PublishProfile=dev01 /p:AllowUntrustedCertificate=True /p:UserName=myDomainUsername /p:Password=myPassword
....
DeployOnBuild = False
....

Note how DeployOnBuild = False, shouldn't it be overriden by the parameter?

Configuration:

Developer box

Visual studio 2013 update 2, webdeploy 3.6 (latest), Web Deploy Publish is based on .pubxml publish profiles.

vs project file excerpt in case it's relevant:

  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
  <PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
  </PropertyGroup>
  <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
  <PropertyGroup>
    <PreBuildEvent>$(SolutionDir)..\..\..\tools\nuget\nuget.exe restore</PreBuildEvent>
  </PropertyGroup>

Build definition

The build definition is for the solution (.sln) not the project (.csproj), with parameters as follows:

/p:DeployOnBuild=True /p:PublishProfile=dev01 /p:AllowUntrustedCertificate=True /p:UserName=myDomainUser /p:Password=myPassword

TFS 2012 box

WebDeploy 3.6 (latest) installed.

There is probably a combination of configuration and concept errors in my approach, would appreciate any input really!

Edu M
  • 594
  • 5
  • 22

2 Answers2

0

You may need to enable Package Restore on your build server. Make sure that you have:

  • Ok thanks, I enabled nuget package restore environment variable on the server as explained in http://bartwullems.blogspot.com.es/2013/07/enable-nuget-package-restore-on-build.html, now nuget works. Didn't have to install vs2013 as suggested - does it generally make life easier to do so? (one could argue it bloats the server unecessarily.) – Edu M May 26 '14 at 15:10
0

Web Deploy Publish not publishing - Solved it by following instructions in here MSBuild not triggering WebDeploy - the only difference being I copied over Web and WebApplications directories from \v12.0 on the vs2013 devs boxes to \v11.0 on TFS 2012

Community
  • 1
  • 1
Edu M
  • 594
  • 5
  • 22