locked
Build.Preview and web applications RRS feed

  • Question

  • I am experimenting with the Build.Preview on TFS 2015 RC.  I have tried to create a build using the Visual Studio Build for an solution that contains a web application.  The result is a get a drop that has the compiled results in a bin folder, but none of the web content is there (like .html, .js, or .cshtml files).  Is there a parameter I can pass to the build to get the web content files in the drop folder?  BTW, having the content there should be the default result.

    Here is the details from my build. 

    "build": [
        {
          "enabled": true,
          "continueOnError": false,
          "alwaysRun": false,
          "displayName": "Build solution Foundation.sln",
          "task": {
            "id": "71a9a2d3-a98a-4caa-96ab-affca411ecda",
            "versionSpec": "*"
          },
          "inputs": {
            "solution": "Foundation.sln",
            "msbuildArgs": "",
            "platform": "$(BuildPlatform)",
            "configuration": "$(BuildConfiguration)",
            "clean": "false",
            "restoreNugetPackages": "true",
            "vsLocationMethod": "version",
            "vsVersion": "latest",
            "vsLocation": "",
            "msbuildLocationMethod": "version",
            "msbuildVersion": "latest",
            "msbuildArchitecture": "x86",
            "msbuildLocation": "",
            "logProjectEvents": "true"
          }
        }
      ],

    Tuesday, May 19, 2015 12:26 AM

All replies

  • Hi Rob, 

    Thanks for your post.

    Do you mean there’s no _PublishedWebsites folder generated in TFS 2015 RC Build bin folder foder web project, so no web content be copied to drop folder after build? Please check this _PublishedWebsites folder in bin folder on build agent machine.


    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, May 19, 2015 8:06 AM
    Moderator
  • Correct, there is no _PublishedWebsites directory.

    I see some issues:

    1) OutDir is not being set.  I'm trying to determine what the value should be.  I can't seem to use variable like  $(Agent.BuildDirectory) in the Variables setup, so a value of '..\..\staging' seems to work

    2) My non-web projects in the solutions, (.exe applications) are not getting copied to the staging directory.  So, I had to set '/p:GenerateProjectSpecificOutputFolder=true' in the MSBuild arguments.

    2) The Copy To Staging section does not need to be checked since the previous changes are now doing the work.

    But this feels like I am not using the new Build system in the way it was designed to be.  I think OutDir should automatically set for a Visual Studio build to something where the default 'Copy to Staging' section would get the right bits to the staging directory.  At the end of the day, a user should just select a solution to build and everything else would just work.

    Tuesday, May 19, 2015 11:21 AM
  • Hi Rob,  

    Thanks for your reply.

    In your build definition, have you selected Copy to Staging Folder option and set Search pattern = **\bin under Options tab? please confirm that. You can refer to the 8 step in this article: http://geekswithblogs.net/jakob/archive/2015/01/15/tfs-build-vnext-ndash-a-preview.aspx.   


    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, May 20, 2015 1:23 AM
    Moderator
  • Yes, that was there for my original build definition.  I selected my *.sln file and I changed the Platform variable to 'x86' (required because this project uses the TFS assemblies) and I left everything else as the default.
    Wednesday, May 20, 2015 12:26 PM
  • Hi Rob,  

    Thanks for your reply.

    I tried to reproduce this scenario in a new fresh TFS 2015 RC Server, but when I start a Build.Preview build definition, it shows “The build has been queued and is waiting to start” in Console, then never really start to build. Have you received this issue before?


    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.

    Thursday, May 21, 2015 9:26 AM
    Moderator
  • John, did you configure a Build Agent?
    Thursday, May 21, 2015 9:35 AM
  • Hi Dennis, 

    Thanks for your reply.

    You mean configure the Build Agent in XAML Build Configuration or for Biuld.Preview?


    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.

    Thursday, May 21, 2015 10:12 AM
    Moderator
  • If you look directory from where you installed the agent, there is a _diag directory that will have log files that should indicate what is failing.
    Thursday, May 21, 2015 4:02 PM
  • I want to add that I created a brand new Web App project, just in case there needs to be something in the .csproj file to work with the build.  I created a new Visual Studio build, accepting all of the defaults.

    The build completes without error, but the drop only contains the compiled .DLL files and not the web files or the _PublishedWebsites folder.

    Finally, the web project that I am trying to build does work correctly with a XAML build.

    Thursday, May 21, 2015 4:35 PM
  • Hi Rob,  

    Thanks for your reply.

    I reproduced this scenario in my TFS 2015 RC Build.Preview, and received the same result. Default settings in Build.Preview build definition will only copy bin directory to staging folder, and then copy from staging folder to drop folder, web project content not included in bin directory, so the web project content will not be copied to drop folder. You can find the information in your build result>>Copy files to staging folder step.  

    I think you can use this workaround to copy both web project content and bin folder to staging folder: in Build.Preview web solution build definition>>Options>>Copy to Staging folder>>set Search pattern= webprojectname(which web project created in your web solution), then save build definition and queue build again. As the web project content and bin folder both in this webprojectname folder, so this webprojectname folder will be copied to staging folder first, then copy staging folder to drop folder.

    The Build.Preview output bin folder structure for web solution is different than XAML build definition or previous version of TFS build definition. For this scenario, please submit it to Microsoft Connect Feedback portal at: https://connect.microsoft.com/VisualStudio. Microsoft engineers will evaluate it seriously.


    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.

    Friday, May 22, 2015 5:47 AM
    Moderator
  • This is not an answer.  Copying the web project as you suggest will copy everything, including the source code and other files that we don't want in the deployed project.
    Monday, May 25, 2015 11:23 PM
  • Hi Rob, 

    Thanks for your reply.

    I said it’s a workaround for the Build.Preview feature in current 2015 RC version.

    As the current version is 2015 RC version(not RTM), for this missed _PublishedWebsite folder in Build.Preview build result scenario, please submit it to that feedback site, Microsoft engineers will evaluate is seriously.


    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, May 26, 2015 3:27 AM
    Moderator
  • Hi Rob,

    I just posted the way to do this.  In the post I was using VSO because the Publish Build Settings task isn't in the RC.  

    http://www.deliveron.com/blog/building-websites-team-foundation-build-2015/

    However, I just reproduced this in TFS 2015 RC and it works fine there too.  Here are the key areas to update.  The last one was the one I had the most trouble figuring out but makes sense now. 

    Build > MSBuild Arguments = /p:OutDir=$(Build.StagingDirectory) /p:CreatePackageOnPublish=True /p:DeployOnBuild=True /p:IsPackaging=True

    Test > Test Assembly = $(Build.StagingDirectory)\*test*.dll;-:**\obj\**

    Options > Copy to Staging Folder > Staging relative Path = $(Build.StagingDirectory)

    Let me know if you have any questions.

    Thanks,

    Mike


    blog - http://www.codesmartnothard.com


    • Edited by MikeDouglasMVP Saturday, July 11, 2015 12:29 PM fixed http link
    Saturday, July 11, 2015 12:27 PM