locked
How to do a publish in new TFS 2105 build definitions? RRS feed

  • Question

  • Hi,

    I am trying to do a pretty simple task:

    1. Build our service solution (wcf)

    2. Perform a publish to transform web.config and create proper folderstructure for website

    3. Move that structure to another server

    In xaml-build definitions I was able to use Publish Profiles, but it seems that TFS 2015 is ignoring the publish profiles. From visual studio I am able to do the following:

    ->msbuild mywebproject.csproj /p:DeployOnBuild=True;PublishProfile=MyPublishProfile /p:IsTFSBuild=True p:/Configuration=MyConfiguration

    And my Publish Profile would trigger and my drop-folder was populated. This is not happening. It seems that TFS 2015 is ignoring the command to Publish?

     


    Kjaps

    Monday, February 29, 2016 2:07 PM

Answers

  • The reason Publish Profile was not triggered by TFS was that MSBuild on the agentmachine did not have the proper files installed. The solution was to copy the 'Web' folder from a machine that have the complet visual studio installed included the web components over to the same location on the buildagents. This solved the issue.


    Kjaps

    Tuesday, March 1, 2016 3:00 PM

All replies

  • Hi Kjaps,

    Thank you for posting here.

    Do you mean that you want to publish Profile in VNext build in TFS 2015?

    If so, in VNext build, choose a step Publish Build Artifacts to publish to a server or a file share.Choose path to the folder or file you want to publish and specify the name of the artifact.

    By the way ,what version of TFS you use before or what version of xaml build template you use? For TFS 2015, there're still xaml build you could use.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, March 1, 2016 7:29 AM
    Moderator
  • Hi,

    In my old xaml-build definition (TFS 2012) . I could specify a publish profile for TFS to run.The old xaml build definition you could specify a publish-profile

    This Publish Profile would publish our web project to a fileshare. By publish i do not only mean to move files, but to do web.config transformation as well.  

    I have tried to use both the visual studio task step, and the msbuild step, but it seems that TFS is ignoring the Publish Profile. Nothing is dropped in my fileshare, and I cannot find any info in the logs about errors. This seems to me like a bug?

    As you can see in this screenshot I am using an MSBUild (currently disabled) task step to run the publish profile but no luck. If I however run the same publish profile from visual studio, it works like a charm.

    I am no longer able to use my old xaml build definions due to an error, but this is secondary. I want to be able to use the new build definitions.


    Kjaps

    Tuesday, March 1, 2016 12:19 PM
  • The reason Publish Profile was not triggered by TFS was that MSBuild on the agentmachine did not have the proper files installed. The solution was to copy the 'Web' folder from a machine that have the complet visual studio installed included the web components over to the same location on the buildagents. This solved the issue.


    Kjaps

    Tuesday, March 1, 2016 3:00 PM
  • Hi Kjaps,

    Thank you for sharing your experience here and you can mark your last reply as answer. It will be very beneficial for other community members having the similar questions.

    All your participation and support are very important to build such harmonious/ pleasant / learning environment for MSDN community.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, March 2, 2016 1:49 AM
    Moderator
  • This solution worked when using File System as the Publish method, but fails when using Web Deploy. I am using the File System method to publish into the running catalog for the web site like this:

    Target location: \\yourwebserver\$\inetpub\wwwroot\yourwebsite

    and it works like a charm. The TFS build service account will need permission to the catalog on your webserver to be able to do this. Perhaps you also will have to do an iisreset to close file-locks before the publish, but that is easy with the new build steps in the TFS 2015 build definitions. You can do that with a command or powershell step.


    Kjaps



    • Edited by Kjaps Wednesday, March 9, 2016 1:14 PM
    • Proposed as answer by Tingting MOModerator Thursday, March 10, 2016 2:24 AM
    Wednesday, March 9, 2016 1:12 PM