I didn’t want to add the NuGet packages of my Visual Studio solution to TFS, because I download all NuGet packages during build.
To exclude all NuGet packages from TFS:
- Add a folder “.nuget” to the folder that also contains the “packages” folder and in most cases the “solution file”.
- Add a file “.tfignore” to the folder that also contains the “packages” folder and in most cases the “solution file”.
More information: http://stackoverflow.com/questions/26604506/tfs-vs-2013-ignore-all-nuget-packages
If you want to undo some changes from a specific user, you can use:
Change directory to folder containing "tf.exe"
• cd "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE"
Check the status of checked out files, to see correct "account"
• tf status "$/TFS/Path/To/Folder/To/Search/For/Pending/Changes" /s:188.8.131.52 /u:* /recursive /format:detailed
Undo pending changes
• tf undo /workspace:"S001";MyDomain\myUserName "$/TFS/Path/To/Folder/To/Search/For/Pending/Changes" /recursive
If you use the Team Foundation Service (on visualstudio.com) as your source control system, you can build your sources in the cloud, but access the build outputs locally.
Just start a new project on visualstudio.com and add a solution with some projects to it.
In my case a ASP .NET Web Api 2.0 project, a integration test project and a unit test project:
In the source control explorer it look like:
Create a build definition
Create a build definition in Microsoft Visual Studio 2013
If you choose for the option "Copy build output to the following Source Control folder (this folder will be created if it does not exist)".
The output of the build will be put in TFS.
So after the build you can download it from TFS and deploy locally.
Downloading can be automated by using PowerShell or some other tooling.
When you choose to put the output of the builds in TFS, you will find a "Drops" folder in the source control explorer.
The build result summary, shows some statistics on the build:
The builds can also be executed online and the result can also be seen online in the browser:
The screencast below explains, how different teams can layout their Kanban board, without changing the default process template statuses "New", "Active", "Resolved", "Closed"
Team A (less columns, then statuses)
Backlog | Active | Done
Team B (more columns, then statuses)
Backlog | UAT | Development | Code Review | Test | Done
Because both Kanban boards use the same statuses under the covers, queries and reports can span multiple teams.
A .NET 4.0 assembly containing a custom Team Foundation Build Activity can only be dragged and dropped from the toolbox on your build process template XAML file, when it is first registered in the GAC. For registering a .NET 4.0 assembly in the GAC you will have to use the gacutil.exe for .NET 4.0 found at [C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil.exe].
If you don’t register the assemlby in the GAC you can’t drag and drop the Team Foundation Build Activity on the build process template XAML file. If it was added by an other developer, you get the error: "Activity could not be loaded because of errors in the XAML":
After registering the .NET 4. 0 assembly with the gacutil.exe, the assembly can be found at [C:\Windows\Microsoft.NET\assembly\GAC_MSIL].
After registering, make sure you restart Microsoft Visual Studio 2010 before you drag and drop the custom Team Foundation Build Activity on your build process template XAML file.
We finally got access to the Microsoft Visual Studio Team Foundation Service Preview.
To learn more about this source control in the cloud thing, check: http://blogs.msdn.com/b/visualstudioalm/archive/2011/09/14/learning-about-team-foundation-service-preview.aspx
If you want to compare two files on disk that are not checked in to TFS, by using Microsoft Visual Studio, you can use the following steps:
1. Open Microsoft Visual Studio > Team Explorer > Source Control
2. Navigate to a random file en right click it:
3. Click on Compare…
4. For the Source Path: Click Browse… > Local Path… and browse to the first file.
5. Repeat this for the target path
6. Click OK
Now the two files will be compared and the differences will be shown, without the files being checked in to TFS.
I was getting the warning / error in the MSBUILD output
CSC: Assembly generation — Referenced assembly ‘mscorlib.dll’ targets a different processor in MSBUILD
After setting the [MSBuild Platform] to [X86] in the build definition, the warnings / errors were resolved.
When you use different (virtual) machines to check out files in Microsoft TFS 2010, different workspaces are used. If you forget to check in a file on machine A, you can’t check that specific in on machine B. To solve this problem there are multiple solutions:
1. Start machine A en check the files in.
2. Use the TFS administration application if you have sufficient rights.
3. Delete the machine A workspace in the Source Control Explorer on Machine B.
After deleting the workspace I could check the files out and in again.
We used the TFS Best Practices Guide on CodePlex for deploying and using our TFS server: http://tfsguide.codeplex.com/
Based on this guide we used the following TFS Structure:
/Main à Can contain solution (.sln) files
/MyApp1 à Contains MyApp1.sln file
/ClassLibrary1 à Contains ClassLibrary1.csproj
/MyApp1Web à Contains Default.aspx
/ClassLibrary1Tests à Contains test project and code
/MyApp1WebTests à Contains test project and code
/MyApp2 à Contains MyApp2.sln file
/ClassLibrary2 à Contains ClassLibrary1.csproj
/MyApp2Web à Contains Default.aspx
/ClassLibrary2Tests à Contains test project and code
/MyApp2WebTests à Contains test project and code
/SharedBinaries à Shared binaries e.g. libraries
/SharedSource à Shared source code
/Docs à Contains product documentation
/Tests à Container for tests
/TeamBuildTypes à Created automatically by Team Build.