TFS add folder and files to checking automatically - tfs

I've have a Solution with Projects I can add to TFS and everything works fine. But I have a background task which generates some yml files outside of my project
Structure:
sln
project1
project1.csproj
serialization
Folder1
*.yml files
Folder2
*.yml files
FolderX
*.yml Files ...
and so on. The structructure under the serialization Folder is "dynamic" and files and folders getting added automatically.
At the moment I need to add the new files and folders directly in the source control explorer by adding new items to the TFS and selecting the serialization folder and the next time when new files and folders are added I need to do this again, ....
Is it possible to say the TFs that i should include all Files and Folders in directory "serialization"?

Use local workspaces; any files added to the mapped workspace will appear a special "Detected: added files" heading under the Pending Changes pane of the Team Explorer, which can then be promoted to include in your pending changes.

Related

Trying to determine why checking in files in one project, would trigger a build in another unrelated project

One of my colleagues has made some changes to a project, named "DB Conversion". There are 2 TFS builds associated with the PharmacyWarehouse project. Here's a picture so you can see what I'm talking about.
A previous TFS Administrator set this configuration up. I inherited it when he left. As you can see PharmacyWarehouse is just a folder. But the 2 builds have a Visual Studio Build step which only looks at the PharmacyWarehouse.sln file in the PharmacyWarehouse folder. I've looked at that .sln file, it only references packages, PharmacyWarehouse and UnitTests folders. I've looked at the .csproj files, they only reference those folders/VS projects.
I've looked at the DBConversion.sln and DBConversion.csproj files in the Projects | "DB Conversion" folder. It only references that folder/VS project. The files my colleague was editing are in the Projects | "DB Conversion" | Models folder.
Why would checking in changes in Projects | "DB Conversion" | Models folder cause the TFS trigger watching the PharmacyWarehouse.sln to fire? Is it because their folders and not TFS Projects?
We're working with TFS 2015
According to the screenshot, you are using TFVC version control.
Open build definition, click the tab Trigger and check the trigger field Path specification and ensure the path is $/Pharmacy Warehouse /DB Conversion
Open build definition, click the tab Get sources and check the field Workspace mappings, ensure the path is $/Pharmacy Warehouse /DB Conversion.
After configuration, if we push the changes to the folder or project DB Conversion, it will trigger this build and only build DB Conversion.

Can we create TFS build definition of website without .proj file

I am using TFS 2015 for creating builds of application. I am able to create build template for web application as web application have both .sln and .proj.
But for Websites, I only have .sln file and no .proj.
How can I create Build definition in TFS 2015 for website having only .sln file?
As #Cece said, the answer is yes, you can run the MSBuild on the server without a .csproj.
I am assuming that your project is not running on the final version of the .Net Framework. In your case I suggest you to make this change
https://stackoverflow.com/a/42493822/819153
Then you should copy all the files from the PrecompiledWeb folder, and there you should find your .sln
Sometimes there are vb/cs projects that I have seen that they do not come with a project file, csproj or vbproject. They run with the .NET Framework 2.0. For those, you can create a build definition just to compile the .sln, but when you deploy the application, you need to copy the entire PrecompiledWeb folder to the IIS folder on your server. Try to add the task that has the option copy and publish and put all the changes to your server.
Check the privilege of the folder where you want to put the files, and be sure that the agent that is running the builds on the TFS has access READ/WRITE access to the server folder.
In your case, please check the .sln file, inside of it you should have a TargetPath, by default is PrecompiledWeb, but sometimes when you run the msbuild on the tfs you end with an error saying that the PrecompiledWeb can't be on the same tree of your solution, what you need to do then is putting a level up of your solution folder
Debug.AspNetCompiler.TargetPath = "..\..\PrecompiledWeb\YourProject"
Then on your CopyTask you need to change the CopyRoot directory, if you made any transformation before your build step to the webconfig, those transformations will be reflected on the PrecomiledWeb\YourProject. All the files in that folder should be deployed to the server folder path.
Lets say that you have this structure in your Branch
Branch/MyProject, then after you compile the source code on the TFS, your precompiled folder will be stored at the same level of your project on the agents folder. Please see the picture below to get the idea how to copy the files from the PrecompiledWeb.
The answer is Yes. You can create a build definition for a WebSite project by specifying the .sln file.

Does TFS download all working folders in build definition?

In my build definition under "Working folders", I have $/MyProject/Main/Source mapped to $(SourceDir).
Does that make it download all files in $/MyProject/Main/Source to $(SourceDir)? Or does it only download what is included within the solution that I'm building if it exists within $/MyProject/Main/Source?
It will download all files under that folder.
If you want to limit what it downloads you can add other paths to the workspace mapping and mark them as "cloak" which will indicate to TFS not to download the cloaked folders.

TFS Build Definition: prevent copy DLL to drop folder

We use TFS 2012 Build server for our Web Project
Build result is copied into folder _PublishedWebsites of Build drop folder
_PublishedWebsites contains all we need to deploy site later
But all DLL existing in _PublishedWebsites are repeated in the drop folder as well.
So we have in drop folder:
_PublishedWebsites
Bin
WebSiteLibrary1.Dll
WebSiteLibrary2.Dll
WebSiteLibrary3.Dll
logs
WebSiteLibrary1.Dll
WebSiteLibrary2.Dll
WebSiteLibrary3.Dll
How to configure Build Definition dll be copied only to _PublishedWebsites ?
You must customize the Build Template: or you tweak the final Copy to Drop Destination, but it could be easier to add a Delete files after that Activity, even if it is slower.
Please, check the names.

exclude bin folder from Team Explorer Everywhere

How can I exclude the bin folder from Check in and Check Out from TFS version control in the TFS plug-in for Eclipse?
The bin folder should already be ignored by TFS unless everywhere is configured differently. Do possibly mean that the bin folder is already checked in and you don't want to manipulate it any more? If that is the case simply delete the bin from tfs and it will stop prompting you for check out/check in. Bin folders typically are not under source control
You can use a .tpignore file to ignore files. The easiest way to add the bin directory to your .tpignore is to simply right click on the bin directory in Package Explorer and select the "Ignore" option in the Team menu.
I had the same problem, I added the following to the .tfignore file
/bin/
/bin/.*
/bin/classes/*
I had to include the classes directory explicitly because it continued to appear in the pending changes.

Resources