128
votes

When checking in my project I get the error:

Could not find file 'C\blah blah blah'.

I have a feeling this might be a file from an old project I deleted.

I have tried deleting my TFS connection and workspaces.

5
I had a similar error from having moved files in my work space. Resolved by removing the work space and creating a new one, then doing a get.Thronk

5 Answers

291
votes

This will happen when TFS has some changes staged that no longer exist on the file system. For instance, if you add some files in Visual Studio (which adds them to the changes list), delete them directly from the file system, then attempt to check in the changes, it will complain that it could not find the file(s).

To remove these changes from the list, you can open Source Control Explorer (View > Other Windows > Source Control Explorer) and either Delete the nonexistent files or right-click on the offending files and Undo Pending Changes.

You can also undo these specific changes from the Pending Changes panel in Team Explorer.

26
votes

Create an empty file to replace the missing file and complete your check-in. After you have checked in the file correctly delete the file that is not needed.

8
votes

Go to the project that has file 'blah blah blah', you should see the file has an error mark indicating it does not exist. Right click the file > Delete. That should take care of the problem.

3
votes

I had a similar problem. I had forgotten I was tinkering with adding publish profiles for publish. TFS felt it needed to check that in, even though the output wasn't there. I simply right clicked on the App.Publish folder in Team Explorer inside of visual studio and chose to exclude. Checked everything back in with no problem.

1
votes

I encountered the same error: enter image description here

but my issue was a bit different. I was changing a couple of folder names and when committing I didn't add the new folders to the repo:

git add folderName

solved the issue for me.