TFS error: item has pending changes but does not exist locally - c#

The following TFS error occurs using Visual Studio 2013 to interface to TFS (TFS apparently also carries the version of Visual Studio with it):
item has pending changes but does not exist locally
This seems very wrong, as one chief purpose of TFS is to give me items that do not exist locally.
Sometimes (but not always) this occurs after a delete, and the purpose is to restore / update the file from the server.

In the Solution Explorer:
right click on file that gives error=>Source Control=>Undo Pending Changes.
right click on file=>Add file to Source control.
Now you are good to go.

Not sure about this but have you checked out a different workspace? Try going to View->Other Windows->Source Control Explorer, then open the Workspace dropdown near the top of the screen, and select "Workspaces..

As it was suggested here, just undo this change, and download will start normally.
To explain what's going on: there are certain conditions on locally changed items (files and folders), and if they are not met, TFS can interrupt downloading sources from server. One of such conditions is that item which is regarded by TFS as locally changed (no matter if you intend to check-in it or added it to "Excluded changes") should actually exist.
For example, some local file was marked to be added to TFS, but not checked in. After that, it was locally deleted from disk. But local TFS still remembers about its existence. So the message tells you that TFS is unable to download new version if the information that this file should be added still exists.

Faced similar message with VS2017. However doing source control -> undo didn't work, it produced message "No pending changes were found for " and problem persisted.
Resolution:
- do "Check out for edit" on problematic file(s)
- source control -> undo
- get latest

Right click on the problematic file in Solution Explorer and click add item to source control.

Related

Load Failed error on a project (of multiple projects in a Solution), after Checking out a git branch from SourceTree

I was trying to Checkout a remote branch (ModuleA) on Source-tree to my Local Repo. The checkout was successful, however one of the Projects of the Solution (the solution contains 17 projects in all) did not check out correctly. when I open the solution on my Visual Studio 2019, it shows the Project Load Failed. it is missing the .csproj file in the physical location. And when i try to Reload it says
"Value Does not fall within the expected range"
I tried to use the Pull and Fetch options again, but no luck. Is there any way I can pull that particular project from the remote? Is there a workaround?
I have tried various suggestions mentioned online, but it mostly asks me to Delete branch and try again. And I am new to SourceTree (and clearly do not like it, for all the unclear messages it shows, without hinting on how to fix it), So please ignore my lack of knowhow on this.
Note: If it helps, I was earlier having issues with this Branch (ModuleA), with Commit and Push of some code i had done, which was not important and had tried to discard / Reset also. But in vain, so I had deleted the whole Branch. And now when I'm trying to start afresh by checking out the branch from remote, I have this issue. Also Note I had two other branches, which were also deleted.

Error or Azure DevOps Error: TF402484 The personnel team project has been deleted

VS2019 with the most recent update... Version: 16.2.5
Main error: TF402484 The personnel team project has been deleted
Also : TF10175 The personel team project does not exist.
As far as I understand so far, TFS new name seams to be "Azure DevOps". Some error say TFS while others "Azure DevOps" but it sounds like it is the same.
It got many errors in many projects (into at least 4 different solutions):
There is 3 to 4 kind of different dialog box errors, depending on where and what action I do related to TFS. All errors are about TF402484 error. The error is about a deleted project which nobody has deleted. Most of the time or always, the project has never been part of the solution.
I did not do anything else than updating my VS2019 to the most recent version.
I red: Visual studio 2013 team project has been deleted
About suggestion from previous link: "Undo any pending changes", yes it could seems to temporarily fix the bug BUT there is something that happen that put me in this situation, that seems to happen very often, intermitently and that's very anoying.
In fact, why do I have many items from other projects (not in my current solution) that appear in the Pending Changes window of my current solution?
Starting Source Control Explorer give me many TF402484 DlgBox error (at least 4) and it show "Working..." and stay like that forever. IT just freeze.
Also, I'm using many instances of VS2019 open at the same time. Could it cause the error?
What's going wrong??? What do I have to turn on/off or set, in order to prevent this behavior which is going to kill me in a near future?
Also, perhaps there is no connection, but the only other thing that also changed on my machine: I'm using Cobian Backup to do my backup and perhaps it touches (changes file time) to all or somes solution files.
The error the Undo any pending changes to that project or branches from that project in your local workspace. indicate clearly. You could give a try with below two ways:
Delete the workspace and created a new one, then check it again.
Team Explorer Home --> Under Solution --> Click the arrow down
behind workspace --> Manage Workspaces... --> Select the specific
workspace then Remove
Note: This will remove all your local mappings. Therefore you should check in all changes before deleting it. or back up
Look at Excluded Changes section under Pending Changes and check
if there are any files which belong to a deleted folder/deleted project. If yes,
right click at the file name and choose Undo.
Besides, you could try to clear TFS cache, which may do the trick.
Also reference this similar thread :
Visual Studio TFS: TF10175 During Add Solution To Source Control in
Visual Studio How To Fix
TF10175: The team project does not exists

how to undo pending changes of files that are unchanged?

One thing that drives me crazy with TFS is the fact that if you have a file checked out, but you made no changes to it, it still shows as a change, distracting you from real changes that you made. This is especially annoying when you use tools such as T4 to generate code, because most of the time the tool will generate the same code, but will leave the file checked out.
For some reason that I can't understand, Visual Studio insists in showing those as changes, and will even claim that there are conflicts if another person happened to check-in the same "changes".
Fortunately, the TFS Power Tools include a command that compares checked-out files with the server version and undoes the unchanged files. I will explain how to integrate it into Visual Studio using a custom tool.
This is unfortunately not available if you are using Visual Studio 2017!
It used to be very simple to accomplish this with earlier versions of Visual Studio:
tfpt uu /noget /r *
How do we remove files from pending changes if they do not have any changes?
This is different based upon your choice of version control system in TFS, so the above problem only exists for TFS' traditional version control system TFVC and not git which has been supported for a few years now.
For TFVS a partial workaround is to mark all files, right-click and Undo... and click Undo Changes button in the following dialog. This will prompt you for the files that are different (letting you choose No or No to All) but not for the ones that have no changes. Important: I write 'partial' because this approach does not work for file renames as the file is considered unchanged so the rename will be undone.
Yes,there are no Power Tools for Team Foundation Server 2017. You could use below workaround:
Right-click on your project ,select undo checkout, then just click okay, or whatever confirmation is left...
Then, while undoing checkout, for every file that has REAL changes in it, a prompt will ask you to confirm the check out for that file... simply click "No to All". Visual Studio will know if the checked out file has changes or none.
WARNING: This method also removes new files, i.e. files that are not yet checked in to TFS. If you want to keep these files then simply exclude them from the set of files you "undo".
You could also take a look at this question: his question Files listed as pending changes when doing merges that didn't change?
The TFSSourceControlExplorerExtension extension is available for VS 2017 and it has an undo unchanged action that works rather nicely.
Stage the change you actually want. The file that isn't actually changed then disappears.

Detected changes in TFS getting all the files

When I get latest version of any project in TFS, all the changes (mainly the packages) are going to detected changes. What should I do after seeing them? Promoting them goes to included changes in TFS and ignoring them gets them ignored while building the solution. Deleting them from disk deletes them completely.
What should I do for getting the latest version without all this complexity?
First you should understand what's the detected changes, and the difference between changes and detected changes.
While edits in a local workspace can be pended implicitly just by
editing the file, adds and deletes still must be explicitly pended.
However, TFS version control’s workspace scanner also detects new
files which are ‘candidates’ for addition, and missing files and
folders which are candidates for deletion. The Team Explorer’s
Pending Changes Page has a link which shows the number of detected
adds and deletes, and provides a link to the Promote Candidate Changes
dialog which can be used to pend ‘real’ adds or deletes on these
items. This is called “promoting” the candidate adds and/or deletes –
because they become real pending changes.
Source Link: Server workspaces vs. local workspaces
In your case, you could just keep the detected changes. Since the most of the detected changes are packages folder, you could also follow Daniel's suggestion use tfignore file to ignore those files. As a result:
When you add ignored files to folders that are mapped in a local
workspace, they do not appear in the Pending Changes page in Team
Explorer.
When you try to add ignored files using the Add to Source Control
dialog box (for example by dragging them into Source Control
Explorer), they automatically appear in the Excluded items tab.
How to create a .tfignore file, you could follow my answer in this question: Visual Studio 2015 TFS .tfignore file

How to check in (or upload) again a solution that i have on my local drive and manually deleted from TFS?

I'm using VS2017 and i have a solution on my local drive.
I had the same solution on my TFS as well, but i deleted it from the repository page manually.
Now if i want to check in the solution again i get a 'no pending changes' message, even if the TFS folder is empty.
I tried a few things but nothing seems to work.
I just don't know how to put these files on my TFS again and i can't find the help i need anywhere. Sorry if it's a duplicated question, i just can't find the answer to this.
Assuming you are using TFVC;
You need to sync (get latest) your local workplace with the server to see any further changes.
If you want to simply "restore" the solution, you can do an "undelete" through the source control explorer.
If do not want to revert your delete, you can get latest (which will remove any unchanged files) and then copy the "new" files over the same location. You will probably still have to and "Add Files" in the source explorer to re-pend them with TFS and then check them in.
In either case, make a backup of the files you are wanting to retain.
The simplest way is creating a branch from a Workspace Version, then check in the branch.
Please follow below steps to do that: (Backup the original project first)
Right click the project directory in Source Control Explorer >
Branching and Merging > Branch
Select Workspace Version for Branch from version By, then click
OK.
Check in the new created branch
Right click the Team Project name in Source Control Explorer and
Get Latest Version to sync delete the original branch (Backup it first).
Rename the new created branch to original one if needed.
Check in the changes
Check the remote server in page site, the project files/code will come
back.

Categories

Resources