TFS Build single folder not being copied - tfs

when building my app on a TFS server, a single folder (with 2 .xml files) aren't copied to the output folder, but all others are.
These files are: a normal xml file and it's tranform version,
This is on the corporate TFS build server and it works for all other files / transformations. So it must be one of my settings in this project / File.
I've checked the files, it's set the same as a .css file that is getting copied (so set to content)
anyone has an idea where I could have a look to find why this is happening?
or even better has a solution for me.

Found that WIX was removing this file

Related

TFS- 2013 auto build Cloaked folder is giving not found issue

Status Source Control Folder Build Agent Folder
Active
$/project111/Dev/Source/Product111_UI
$(SourceDir)
Cloaked
$/project111/Dev/Source/Product111_UI/kendoUI/Modules/Sample
above are the my work space settings from build configuration.
It is giving below issue while copying build.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\WebApplications\Microsoft.WebApplication.targets (182): Could not copy the file "Modules\Sample\AliasConfig\AliasConfig.html" because it was not found.
do I missed any configurations still, please help me out in this. if any
solution.
It looks like you have a reference to the output of that .html fil le somewhere in your build logic. Cloaking the folder means that it is not there so the error is correct.
You need to find where you have a reference to that .html file in your build logic.

Publishing GulpJs minified/concatenated javascript via MSDeploy and Teamcity

Apologies if this question has been asked before. I have found variants on this theme but nothing that seems to fit our particular configuration.
We have developed a custom GulpJS task which parses a .json file located inside our folder assets/javascript. This json file contains an array of relative paths to javascript files (both our own and library) in a specific order for minification. They are then outputted to the folder assets/javascript/build and concatenated. The javascript source files are in the project but the minified and concatenated versions of the scripts, in fact the entire build folder itself, are not included in the Visual Studio project.
Ideally, I would like to have a step in the MSDeploy configuration which would copy all the files in the javascript build folder to the destination. Otherwise I could potentially include another step in Teamcity to do so.
Has anyone successfully instituted a similar build configuration and could share some insight? I tried using the MSBuild copy task but that didn't seem to copy the files to the output location. One option that I am considering is including the minified scripts in the project file but this might potentially trip up other developers who don't have Gulp running in their development environments (hilarious as that might be)

Release manager for TFS 2013 app.config processing with token files

I seem to be getting a lot of pain with the processing of app.config and token files (we have this working with the older ".11" templates).
It looks like currently (using the ReleaseTfvcTemplate.12.xaml) this is running the tokenisation after the build.
While I can make the app.config / myapp.exe.config stuff work by deliberately copying the .token file into my output folder (so the recursive search finds it) this feels pretty horrid.
As a fix I'm tempted to move lines 182-230 to just before the RunMSBuild task on line 175 (creating a new sequence at that point)
Is this the correct approach or have I missed some documentation somewhere (or a later version of the template?)
Thanks guys... Anyway for future reference I did make the change.
However I had misunderstood the exact nature of the order things happen out of the box which is as follows:
Get the project out of source control
build with msbuild
Copy the .config.token file over the .config file. This is in the TFS template
As part of the deploy to a server then the token entries in the .config files are replaced. This is in the release manager template.
Tests are run in the msbuild binary output folders.
The problem is this doesn't really work if you're using an project type that uses app.config file as the msbuild process renames these output.exe.config during the msbuild stage so you need to create both an output.exe.config (marked as copy to output) and an output.exe.config.token so when the post deploy is the final output gets configured correctly. This also a problem if you want to tokenise some mstest dlls as these typically use an app.config as well. Basically this is a bit of a mess unless you are using web.config.
We worked our way around this by using the modification I suggested above (you need to create a sequence at line 175 and move lines 178-230 up into the sequence, this is GetBuildDirectory variable bits and the if statement) followed by adding an additional deployment stage which copies back onto the build server with the new tokenised files so the mstest can run against them.
So our new process looks like this:
Get the project out of source control
Copy the .config.token file over the .config file i.e app.config.token copied over app.config
build with msbuild (this means we end up with tokenised myapp.exe.config and mytests.dll.config)
As part of the deploy to a server then the token entries in the .config files are replaced. This is a release management step in the release template.
Deploy the tests back into a folder on build server (think this has to be a fixed folder until update 4 of release manager is deployed) the token entries in the .config files are replaced (so our integration tests can use the newly deployed servers). This is a release management step in the release template.
Tests are run in the fixed folder on the build server (rather than the msbuild output directory) so the test wildcard needs to be changed in the tfs build template.
Quick final note we don't use that build directory variable and it's left at blank I'm not convinced this would work if it was set to a value...
The replacement of variables in config files with Release Management happens at deployment time and not at compile time.
When RM deployes your app it inserts the correct variables.
It sounds like you're hitting one of two issues:
You need to include the .token file in your project and make sure it's set to Copy Always, so that it gets copied to the build output folder.
If you're building a web application, I've seen a bug in the release build process template that doesn't touch the contents of the _PublishedWebsites folder. I don't know if it's been fixed in Update 4 or not, but it was definitely still a problem in earlier versions.

TFS Build Issue with Typescript and Web Deploy

I have a strange issue where one of my builds is failing to create the web deployment package that other similar builds are creating. I am running TFS 2013.2 and all my clients are VS2013.2. Build server is also TFS 2013.2. The web application is .NET 4.5.1.
The purpose of the solution is to build and deploy two web applications using web deploy (publish profiles). The first applications compiles and deploys just fine. The second one fails very strangely.
The gist of what I think is going on is that the build service is copying source files to a temporary location to be zipped up. Here's a chunk from the log:
CopyAllFilesToSingleFolderForPackage:
Creating directory "obj\Development\Package\PackageTmp".
Copying all files to temporary location below for package/publish:
obj\Development\Package\PackageTmp.
Copying Scripts\path\production\Constants.js to obj\Development\Package\PackageTmp\Scripts\path\production\Constants.js.
Copying Scripts\path\production\Directives.js to obj\Development\Package\PackageTmp\Scripts\path\production\Directives.js.
Copying Scripts\path\production\ProductModule.js to obj\Development\Package\PackageTmp\Scripts\path\production\ProductModule.js.
Copying Scripts\path\production\Controllers.js to obj\Development\Package\PackageTmp\Scripts\path\production\Controllers.js.
Copying Scripts\path\production\Models.js to obj\Development\Package\PackageTmp\Scripts\path\production\Models.js.
Copying Scripts\path\production\Services.js to obj\Development\Package\PackageTmp\Scripts\path\production\Services.js.
Copying Scripts\path\path3\path3Controller.js to obj\Development\Package\PackageTmp\Scripts\path\path3\path3Controller.js.
Copying Scripts\path\path3\path3Module.js to obj\Development\Package\PackageTmp\Scripts\path\path3\path3Module.js.
Copying Scripts\path\path3\Directives.js to obj\Development\Package\PackageTmp\Scripts\path\path3\Directives.js.
Copying Scripts\path\path3\Filters.js to obj\Development\Package\PackageTmp\Scripts\path\path3\Filters.js.
Copying Scripts\path\path3\DetailController.js to obj\Development\Package\PackageTmp\Scripts\path\path3\DetailController.js.
Copying Scripts\path\path3\ListController.js to obj\Development\Package\PackageTmp\Scripts\path\path3\ListController.js.
Copying Scripts\path\path3\Models.js to obj\Development\Package\PackageTmp\Scripts\path\path3\Models.js.
Copying Scripts\path\path3\Services.js to obj\Development\Package\PackageTmp\Scripts\path\path3\Services.js.
CleanWebsitesWPPAllFilesInSingleFolder:
Removing directory "obj\Development\Package\PackageTmp".
You can see it's copying from the source to some temporary directory. Directly after, it completes removes that directory for whatever reason.
Then, it runs through a number of other actions such as
ValidateGlobalPackageSetting
CollectFilesFromIntermediateAssembly
CollectFilesFromContent
CollectFilesFromIntermediateSatelliteAssembliesWithTargetPath
CollectFilesFromReference
CollectFilesFromAllExtraReferenceFiles
CollectFilesFrom_binDeployableAssemblies
PipelineCollectFilesPhase
PreTransformWebConfig
TransformWebConfigCore
PostTransformWebConfig
PreProfileTransformWebConfig
PipelineTransformPhase
GetMSDeployInstalledVersionPath
ProcessPublishDatabaseSettings
PreAutoParameterizationWebConfigConnectionStrings
AutoParameterizationWebConfigConnectionStringsCore
PostAutoParameterizationWebConfigConnectionStrings
PipelineMsdeploySpecificTransformPhase
GenerateGlobalPublishSetting
Then we get to where it appears to want to create teh publish package for real this time
CopyAllFilesToSingleFolderForMsdeploy
Creating directory "obj\Development\Package\PackageTmp".
Copying all files to temporary location below for package/publish:
obj\Development\Package\PackageTmp.
Copying obj\Development\Package\PackageTmp\Scripts\path\path2\Constants.js to obj\Development\Package\PackageTmp\Scripts\path\path2\Constants.js.
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(2660,5): error : Copying file obj\Development\Package\PackageTmp\Scripts\path\path2\Constants.js to obj\Development\Package\PackageTmp\Scripts\path\path2\Constants.js failed. Could not find file 'obj\Development\Package\PackageTmp\Scripts\path\path2\Constants.js'. [D:\Builds\1\path.Web\Portal_Dev\Sources\Portal\Trunk\Code\path.Portal\path.Portal.Web\path.Portal.Web.csproj]
Done Building Project "D:\Builds\1\path.Web\Portal_Dev\Sources\Portal\Trunk\Code\path.Portal\path.Portal.Web\path.Portal.Web.csproj" (default targets) -- FAILED.
The strange part is that it's NOT copying from the source. It's attempting to copy from the temp location. First, the temp location has already been cleared. Second, that really doesn't make any sense at all to copy from obj\Package to onj\Package and not from Scripts\ to onj\Package
Here's the msdeploy argument that i'm using. It's working as is on several different builds.
/p:DeployOnBuild=true;PublishProfile=Development;DeployTarget=MSDeployPublish;MSDeployPublishMethod=RemoteAgent;MsDeployServiceUrl=http://someServer:9090;SkipExtraFilesOnServer=true;username=
My build template is a bit old, but I'm not having issues with any other builds or deployments.
I know there's probably more stuff I should provide. Please let me know what else I can add to help trouble shoot
EDIT: I mention typescript in the title. All of the files it's trying to copy are JS files generating from Typescript. They all have their build action set properly. The other we application project in this solution has no typescript at all and builds and deploys fine.
Also it's worth mentioning that if I manually publish from visual studio using the profile specified in my command line arguments, everything deploys just fine.
I changed build templates to the newest template and it worked. I lost all my customizations, but that points to my build template causing the problem

Teamcity is not copying all the folders

I've now setup a MSBuild script to create the folders and files I need in the right structure for my MVC project. I'm then setting Teamcity up to look at the folder with only the files I want to have and copy that to the artifacts folder. So far, so good!
However, There is a few folders in the structure that are empty, and Teamcity does not copy these folder, even if I've set it up to copy the mainfolder and everything in it.
Is there a way to force Teamcity to copy everything - and by that I mean EVERYTHING in my folder, or does it simply not work?
Teamcity Artifact path settings:
Website => Release
You may find your answer in this post : How do I exclude the contents of a directory but not the directory itself in MSBuild
It's not Teamcity but still MsBuild. The problem is that msbuild's include does not include empty directories...
We manage to work around this and skip the empty folders. Therefore this was no longer an issue. However, still don't know how to copy empty folders. My understanding from doing research for a long while now is that it simply doesn't work.

Resources