3

We just upgraded to TFS2015 (onsite) and I'm trying to set up a build that will do the same thing as my xaml builds but I can't seem to get the same files built. Here's a picture of the xaml output directory that I use to publish the site. To get this I navigate to the build folder then drill down to the _PublishedWebsites\BOTWSitecoreWeb folder:

enter image description here

Here's a picture of the solution explorer:

enter image description here

So as you can see BOTWSitecoreWeb is my startup project and it forms the basis for the website. So to publish this website I simply copy the folder: _PublishedWebsites\BOTWSitecoreWeb to my IIS directory. Here's what it looks like using the xaml build:

enter image description here

And if I drill down into the TFS2015 build output folder into the Drops/Source/sc/Website folder I get this, which has many more files and folders than what I'm expecting:

enter image description here

So my question is how can I get the same output that I currently get from my xaml builds from a TFS2015 build?

The bin folder has the same number of files, so that's a good start. Here's the bin folder from the xaml build:

enter image description here

And here's the bin folder from the TFS 2015 build. Notice that they both have 57 files, which I assume is a good thing!

enter image description here

Thanks in advance for any insight you can provide!

Ben

Ben_G
  • 770
  • 2
  • 8
  • 30

2 Answers2

5

Update your build definition to below:

  1. Add /p:DeployOnBuild=true /p:OutDir="$(build.artifactstagingdirectory)\\" arguments in Visual Studio Build step: enter image description here
  2. Change "Path to Publish" of "Publish Build Artifacts" task to "$(build.artifactstagingdirectory)_PublishedWebsites\ProjectName": enter image description here

Save the build definition and queue a build, now you should get the same files published in drop folder like XAML build.

Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60
  • Thanks Eddie - that did it! – Ben_G Aug 31 '16 at 18:56
  • i have one .sln project and under it have 2 project like web and api, my question is that should I add the both projects bin into the source control , if yes than, if I mad some change in dll , that TFS build artifact is not producing the latest web dll ? – Saad Awan Aug 19 '20 at 11:57
  • Please answer on below post as well https://stackoverflow.com/q/63059180/10846390 – Saad Awan Aug 19 '20 at 12:04
  • Under $(build.artifactstagingdirectory)_PublishedWebsites\ProjectName\bin , not generated the build own binaries? its the old one which are under Source Control – Saad Awan Aug 20 '20 at 07:08
0

vNext build and XAML build, it's totally different technology. There won't be any automated ways of converting.

The new builds are based on a different architecture and run on a completely different system.

So your situation is predictable, it's very hard to achieve a 100% conversion. Copy the folder in vNext will copy everything under the folder by default. Seems there are some customization during the copy or published in your XAML build which will return the result as above picture.

If you have heavily customized XAML builds and custom activities, you can continue using those builds until you are ready to port your business logic into scripts that can run in the new builds.

And you could also take a look at these series of articles how to upgrade from XAML to Build 2015 with minimal changes.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Hi Patrick. Thanks for the response. So there's no way to get a simple output directory from the new team build that has everything I need for a deployment? (i.e. the /bin folder and all of the other subfolders containing the aspx files, config files, etc.?) That just seems so wrong! What's the point of doing a build if the output of the build isn't ready for deployment!? – Ben_G Aug 17 '16 at 16:17
  • Well, a typical way to use in vNext build is to publish your build artifacts with the Copy files and Publish build artifacts steps. Try to use the local path on the agent where any artifacts are copied to before being pushed to their destination. For example: `c:\agent\_work\1\a`. You can use the variables `Build.ArtifactStagingDirectory` just as _Eddie_ suggest. More variables please refer [Use build variables](https://www.visualstudio.com/en-us/docs/build/define/variables) – PatrickLu-MSFT Aug 18 '16 at 08:21
  • Thanks Patrick. I think that the problem is that c:\agent\_work\1\a (which is where $(Build.ArtifactStagingDirectory) points to is empty after the build. Why is that? – Ben_G Aug 31 '16 at 18:47
  • Please also answer on below post problem https://stackoverflow.com/q/63059180/10846390 – Saad Awan Aug 19 '20 at 12:03