56 subscribers








  |  Technology  |  Science Stuff  |  Travel  |  Golf  |  Entertainment  |  Buddhism  |  Finance and Investing  |  Austin  |  India  |  Diet, Health  |  Petitions, Causes  |  

Posted on by Anuj Varma
TFS Error–Source File Could Not Be Opened (‘Unspecified error ‘)

Symptom

File has already been deleted (from source control and from the filesystem). Yet – the file shows up in the Visual Studio solution (with a yellow warning icon next to it). When one tries to compile, one sees the above error:

source file could not be opened ‘unspecified error ‘

What does not work

By now you’ve already tried all the usual suspects. Tried refreshing, closing (and re-opening VS), clean command etc. Nothing seems to work. 

The Source of the Problem

Something in Visual Studio is obviously remembering a reference to the file path and name. An obvious suspect is the .csproj file for your project. If you look inside it, you will see a reference to the source file that is throwing the above error.

The Solution

Simply delete the entry from your .csproj file – and you should be good to go. Somehow, the .csproj did not remove the entry when you removed this file (perhaps because you first deleted it from the filesystem before deleting it from the solution). That’s it – if you run into this obscure ‘Source file could not be opened  – Unspecified Error’, try editing your .csproj file and see if that fixes it.

Recent Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

*