Is it possible to add report feature with a created team project in TFS? - tfs

It's clear if you use Team Explorer in Visual Studio 2017 to create your new team project, the reports folder will be created and the default reports added.
However, my classmate used web interface instead to create a new team project, which does not create the reports folder for that new team project.
I didn't find a way to add report for that existing project after go through everywhere in web portal. Is it possible to do this?
I'm using TFS2017

You could use TFSConfig command line to handle this.
To add the reports folder use the following steps.
Log onto your TFS server
Open a command prompt as an administrator
Navigate to the C:\Program Files\Microsoft Team Foundation Server
1x.0\Tools directory Enter the following command, entering the
appropriate values for each parameter.
TFSConfig addprojectreports /collection:”http://yourtfsserver:8080/tfs/DefaultCollection” /teamproject:”Patrick” /template:”Agile”
This command will create a report site and folder. It will report its progress and output to the screen and a log file as it goes. Hope this helps.

Related

VS 2019 unable to add a file to TFS

I'm currently using VS 2019 Professional and TFS as my source control. I've created an XML file on Notepad++ and placed it in a location that TFS is aware off in file explorer.
Usually with older version of VS, I would be able to right click the file and select "Add" under the TFS extension. From what I can see, this option is no longer available for 2019: Team Foundation Server Power Tools for Visual Studio 2019
I've tried going down the path of using the dev command prompt and set a system variable with the
name: tfs
value: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe
and once I attempt to run the following command: tfs add myFile.XML with the CD path set to where I want the file added, I receive the error:
'tfs' is not recognized as an internal or external command,
operable program or batch file.
Was hoping to see if there's anything I was doing wrong here or if there's another way I can go around to achieve adding a file?
Just in case anywhere stumbles across this in the future, on VS if you go to the Source Control Explorer Screen, navigate to the directory you'd like the file added to then right click anywhere on the screen and select Add items to folder

Unable to validate collection

I am trying to set up TFS for vscode. I am getting the error, unable to validate the collection assuming 'default collection', when signing in. Any recommendations oh how to resolve this issue.
Firstly make sure you have correctly set the TFVC support.
Below is a short list of steps to get up-and-running with TFVC support:
Install the Team Services extension for Visual Studio Code.
Team Foundation Server requires your domain credentials.
Ensure you have a TF command line client installed (either TF.exe or
the TEE CLC).
Set the tfvc.location VS Code setting to the full path of your TF
command line client.
Open a folder containing a Local TFVC Workspace and sign in when
prompted.
Set the SCM Provider to TFVC.
For more detail tutorial you could also take a look at my reply in this question How can I connect to on-premises TFS using visual studio code?
Back on the error message, it may related to the workspace. Check if you have correctly mapped the workspace. Just try to remap the existing workspace or create a new workspace and map sources to a new local folder, then check that again.
Also just try to specify the collection and team project name in the user settings like this:
{
"tfvc.location": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\tf.exe",
"team.remoteUrl": "http://server:8080/tfs/collection",
"team.teamProject": "TeamProjectName",
"tfvc.restrictWorkspace": true,
"window.zoomLevel": 2
}

Can't create more team projects after update

After updated my TFS 2013 server to Update 4 i can't create anymore any team project inside visual studio. I receiving this error. I searched in entire network and already deleted my cache folder and changes xml agile file to false Like says in this page.
Resolved.
I downloaded C:\Program Files\Microsoft Team Foundation Server 12.0\Tools\Deploy\ProcessTemplateManagerFiles\1033\MsfAgile\Template.zip and unziped. In Xml file put all to false.
In my computer and in TFS Explorer > Settings > Process Manager Template Upload folder again and all works.

How to create a web deploy package for a website project during TFS build process?

My current TFS build process just build my website project and output all the files, such as assemblies, web.config, etc.
From here, I learned how to create a web deploy package with MSBuild in command line.
But I want to know how to insert this package step into my current TFS build process.
Thanks for any insight.
Create your release package by creating a publish profile through Visual Studio. For this example mine is called Release. this will create you a Release.pubxml file in a folder called Publish Profiles, under your project, check this into source control.
Then in your build definition, under the process tab.
Expand the 02. Build > 5 Advanced or similar depending on the version of TFS you are using, add the following to the MSBuild argument text box
/p:DeployOnBuild=true;PublishProfile=Release
ensure the PublishProfile has the same name as the one you created earlier (Release)
this will create your deployment package as part of the build

Team Build Error: The Path ... is already mapped to workspace

When creating a new build in Team Foundation Server, I get the following error when attempting to run the new build:
The path
C:\Build\ProductReleases\FullBuildv5.4.2x\Sources
is already mapped to workspace
BuildServer_23.
I am unable to see a workspace by that name in the workspaces dialog.
Use the command line utility TF - Team Foundation Version Control Tool (tf).
You can get a list of all workspaces by bringing up a Visual Studio Command Prompt then changing to your workspace folder and issuing the following commands:
C:\YourWorkspaceFolder>tf workspaces /owner:*
You should see your problem workspace in the list as well as it's owner.
You can delete the workspace with the following command:
C:\YourWorkspaceFolder>tf workspace /delete /server:BUILDSERVER WORKSPACENAME;OWNERNAME
Just delete the contents of the following folder(s):
C:\Users\UserName\AppData\Local\Microsoft\Team Foundation\3.0\Cache
Where UserName is actual or current user, and 3.0 is the version number.
I had a similar issue and to remove the workspace that was causing me a problem, I logged into another machine with TFS client installed and performed the following:
On the File menu, point to Source Control, Advanced, and then click
Workspaces....
In the Manage Workspaces dialog box, tick the Show remote packages checkbox.
Under the Name column, select the workspace that you want to remove, and then click Remove.
In
the Confirmation dialog box, click OK.
I received this error, which was caused by having two build definitions that pointed to the same source. The issue was that I used a static build directory in the Build Agent.
This forum post describes my issue and resolution exactly:
http://social.msdn.microsoft.com/Forums/en-US/tfsbuild/thread/60a4138a-9b28-4c46-bdf4-f9775ce43c3e/
We had the same problem but deleting the workspace's from the TFS server did not work.
(I should mention that I grabbed my colleagues VM that was already set up with his credentials.)
For me this worked:
http://blogs.msdn.com/b/buckh/archive/2006/09/12/path-is-already-mapped-in-workspace.aspx
I just went into the : ...\Local Settings\Application Data\ made a search for VersionControl.config, opened up the folder that contained this file and deleted all of it's contents.
Previous to that I tried manually editing the file but it continued with the same error message.
I hope this helps.
For some reason I was having trouble deleting the workspace from the command-line utility. Luckily I found Team Foundation Sidekicks 2010 (from this post) which is free and provides a GUI for viewing and deleting TFS workspaces, and many more useful TFS features.
I had a similar problem with Visual Studio 2010 complaining about an already-mapped-workspace, but instead of deleting the entire workspace, I used the following from the Visual Studio Command Prompt: "tf workspace PROBLEM_WORKSPACE_NAME". This brought up an "Edit Workspace" dialog. From there I was able to remove the path in question from the "Working Folders" list, which got rid of the error.
the rest was fairly easy.
Simply go to this folder:
C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\4\Cache
and delete all that's in the folder.
I was getting an exception telling me that the file was already mapped in another workspace:
"The path {File Path} is already mapped in workspace {Workspace Name}."
This workspace was deleted beofre.
With the help of friend of mine I found out that TFS save workspace info under the user local settings dir. We found a file named:
VersionControl.config under {User Documents and Settings dir}\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache.
This file contains all the local mapping of TFS. Probably when you use the Map method and don't use:
public void DeleteMapping(WorkingFolder mapping); before deleting the workspace the mapping information is not removed from this file which is used by TFS to check if you've alreay mapped a specific path.
To resolve this problem delete all the keys from the config file. Don't delete the file because you'll get it again from the server cache.
Here is what I did (well what I do):
Using TFS Sidekicks clear out the user and server filters so they are blank. This will let you get all workspaces.
Check the build error for the workspace name. In the OPs case it is BuildServer_23. It is different in my environment but basically just match up the error name with the one in the tfs sidekick list.
Click the red x to delete the workspace.
Viola!
If applicable, you can also clone the build definition and change its name. This workded for me.
I tried all the following solutions such as :
Use sidekicks to delete WS.
Use tf commands to delete remote server workspaces.
Delete the TFS cache folder.
The following worked for me:
tf workspaces /remove:*
If you don't have permissions on the server to delete other people's workspaces, you can just change the name of the build definition. TFS will create a new workspace and map it to "C:\Build\ProductReleases\new build name here\Sources".
While trying to 'Get latest version' of a project which I had previously mapped to a local directory and then deleted, I saw this same error message.
First I tried the SideKick tool and then the Visual Studio 2010 command prompt, both of which told me I had no workspaces mapped.
Next I searched for 'VersionControl.config' within c:/users/myuser/appdata, and deleted the 4 references it found.
I re-opened Visual Studio and I was able to re-map the project, no more error!
Simplest way to do this is to go to your AppData and delete the TFS cache (depending on the version 3.0 or 4.0)
C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\3.0\Cache
or
C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\4.0\Cache
TDN's solution worked for me when I was having the same issue. The Build server created workspaces under my account. Checking this box allowed me to see and delete them.
I got same issue in Visual Studio 2017 and TFS 2017. DefaultCollection must be mapped first to you local path. Somehow this step was skipped and I got only MyFirstProject mapped.
All you need to do is:
- 1. Go to your TFS web page and remove the project from the server.
- 2. Remove the project from your local "Worksapces"
- 3. Go to "Manage Connections" which will refresh your Home page in TeamExplorer.
- 4. You will get Configuration page which will allow you to setup root path to your DefaultCollection.
- 5. You should get message that it been done successfully. Now you can create your project.
It's important to map root of your collection to your workspace first and then map a new project.
My issue was related to using multiple accounts. This is how I was able to switch accounts.
Open Team Explorer
From the big drop down menu near the top of the pane...
Navigate to:
Projects and my Teams>Manage Connections
Navigate to:
Manage Connections>Connect to Team Project
Use the "Switch User" link to switch accounts.
Now the workspace names will match the chosen account.
I couldn't get any other solution to work.
I had a new account created and the old account no longer had permissions (both on same machine).
I tried:
1) Deleting the workspace (couldn't see in VS with or without remote workspaces checked)
2) Deleting from the command line
3) New owner command
4) Deleting the cache
So I simply opened VS as admin and mapped to a different folder.
Deleting the workspace and cache was not sufficient for me.
I had to also restart the "Visual Studio Team Foundation Build Service Host" service.
Go to the Source Control Explorer
In the toolbar there is a dropdown list of Workspaces.
Click the dropdown and go to workspaces.
Remove the unwanted workspace.
Map to your local.
I changed
Build Definition -> Workspace -> Build Agent Folder
from
c:\some\path
to
$(SourceDir)
and it fixed the issue.
I had this issue with this with Azure DevOps automated builds in an on-prem TFS build agent. Removing the workspace using TFS Sidekicks did not work. And tf.exe could not even find the workspace to delete it.
This solution should work for TFS 2017, TFS 2018, Azure DevOps, and possibly other versions:
Take note of the workspace GUID in the error message.
On the machine where the build is taking place, navigate to: %USERPROFILE%\AppData\Local\Microsoft\Team Foundation\ (where %USERPROFILE% belongs to the user that triggered the build).
Search for and remove all instances of the workspace GUID under that directory. There will likely be a folder in a 'cache' directory, as well as entries in 'LocationServerMap.xml' and 'LocalItemExclusions.config'. Remove them all.
That worked in my circumstance.
Simply delete the workspace:
workspace /delete "the-workspace-name"

Resources