Why doesn't TFS download subfolders if they are mapped elsewhere - tfs

I have a few environments setup that connect to TFS through an eclipse based IDE. I have the main project folder mapped to a local folder and I have 2 subfolders mapped to a different place locally. For some reason on only one of the environments when I perform a get operation, the subfolders that have been mapped additionally are not downloaded on both the main project folder and the external mappings.
I have tried recreating the workspace, removing the mapping, to re-install TFS 2012
What could be the possible culprit?

Have no business with subfolders if they are mapped elsewhere. You just make sure to perform a get operation at one or more level up of that subfolders.
In you case, you could first check the mappings for main project folder and 2 subfolders. Make sure they are in a same workspace.
Then try to get root folder in that workspace, check if this work.
Also try to clear TFS cache in your dev machine, which may do trick.
If all of above still not work, suggest you use get command line to download the folders, add /recursive such as tf get $/Project/Main/recursive
Recursively gets items in the specified directory and any
subdirectories.

Related

TFS: How do I get a list of managed files in my enlistment?

In tfs, how do I get a list of files in my working directory that are being managed by tfs? I don't care if I've checked them out or not (if I did, tf status would be the obvious choice). I just care whether or not tfs is tracking changes for them or not.
I want to use this like I use hg locate for Mercurial. I want to search through all the files that are not temporary files or build products of some kind, things that are part of the base source code, for something that shows up in the build products, but I don't know where it comes from.
Try to use LocalVersions command. (The newly be added file won’t be list)
You could use tf workflod command. Which could displays information about the mappings between your workspace folders and the folders on the server for Team Foundation version control.
The following command displays the working folder mappings for the workspace in the current directory:
C:\projects>tf workfold
If you want to list the working folder mappings for a different workspace, you can specify the /workspace:workspacename parameter.
C:\>tf workfold /workspace:My_Other_Workspace
Required Permissions
To use the workfold command, you must be the owner of the specified or implied workspace or have the global Administer workspaces permission set to Allow.

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.

TFS build modifying website folder structure

In my solution I have a basic ASP.NET MVC website and a Wix Project. To identify the files that need installed I'm using Heat (a Wix component) to index the build output. This is part of a post-build event. It works perfectly on my local machine when building in Visual Studio 2015.
My problem occurs when checked-in and the CI (TFS Build) builds it. The differences are:
The contents of the bin folder is placed directly in the build folder
The rest of the website is placed under a new _PublishedWebsites folder
This means many of the references get broken. For example when dropping the _PublishedWebsites folder into IIS breaks (as .net cannot locate the contents of Bin)
After much research on the subject, and many attempts to pass MSBuild parameters, I'm reaching the end of my efforts.
Is there a way for a build in TFS to leave file locations intact without copying and creating new folders?
If not what is the recommended way to get a deployment ready site (in a single folder) from TFS?
Adding a Copy Files task to copy bin folder to $(build.artifactstagingdirectory)\_PublishedWebsites, check the screenshot below:

How to fix broken TFS working folder

I don't know how, but TFS is claiming files in the same workspace folder are mapped to different local directories. The TFS client is showing me a working dir but some files are mapped to a sub-dir when I do compare/check-in operations.
I have tried to remove and reinstate the workfolder mappings but it hasn't helped.
Possibly files checked out for edit before a workfolder is remapped are to blame?

How to keep the subfolder in DropLocation constant in TFS build

I have a build definition setup with a drop location. The binaries are moved into this location, but under a new directory (named as build number) every time. Is there a way to have the same location over written everytime. we have some batch files that copy the binaries out to multiple servers that will be accessed by the end users. We need the location to remain constant so that the batch files can work correctly.
If this is not possible, is there a way for the batch files to pick the latest location which contains our exe (sometimes, the folder is created even when the build failed).
Having an unique name of the drop location, is something you cannot (and don't want to) change. To solve your issue, you can either
1) start the batch files with arguments (so the directory is %1) where you specify the name of the directory
2) Add a task in the build to copy all the files to a file share. If you are using TFS 2008, you can follow the steps provided at http://blogs.msdn.com/b/msbuild/archive/2005/11/07/490068.aspx to copy the files.
If you are using TFS 2005/2008, then TFS Deployer. It flat rocks when doing deployments.
TFS 2010 has a new build deployment model that is pretty good.

Resources