Visual Studio 2010 file could not be found in your workspace issue

file, visual-studio-2010, workspace

Solution

It turns out the issue was with one of the "facts" in my question, "file that's not yet in the repository".

A file with the same file name I had locally was already there in the TFS repository, it had been checked-in a month ago by someone else.

Only when I tried to check-in the new local copy I became aware of that; the file was not supposed to be there.

Anyway, after checking-out the file from TFS everything went back to normal; I'm able to edit/save the file without issues, even if connected to TFS.

Problem

I'm getting this message when connected to a TFS repository and trying to edit a local `.sql` file that's not yet in the repository. The item C:\bla\blabla\blablabla\USP_BLA.sql could not be found in your workspace, or you do not have permission to access it. No items were checked out If I disconnect from the TFS repository everything is fine. If I re-connect to the TFS repository I start getting the message, even just trying to type/save the file. The file is actually there in my local folder and I have the corresponding permissions, for those who are thinking otherwise. It is just a text file that I should be able to edit irrespective of whether I'm connected to the repository or not. I got Windows SP1 installed on my Windows 7 this morning; don't know if that could be the cause of the issue. We are using the.NET Framework 4. Any idea of what the issue is or how to resolve it?

Original source