When compiling a project for the second time I get the following error message. I have to close down VS 2010 and it compiles when reloaded. If I make a change then the problem c
I also hit this issue when trying to save a file in Visual Studio (so non XNA, but google seems to be guiding here).
Problem turned out to be that I had a partially completed git command running in my terminal - it was a diff against the file I was trying to save.
When I terminated the command then the problem went away.
Found cause - it's to do with having Visual Studio Achievements extension installed. The problem goes away with this extension removed.
I've got the same problem, but I don't have Visual Studio Achievements extension installed !
I'am totally stucked with this problem, I con not build my code any more.
For me it was Git extensions locking the file up. I killed the git process that had got stuck and rebuilt the project. If you cant find whats locking up the file you can always restart the computer :)
I also faced the same issue due to a stupid mistake :) All I did is I kept the corresponding output dll open in Visual Studio Object Browser. Closing that dll from the object browser resolved the issue.
In my case, this error was being caused by Microsoft Security Essentials scanning the file as soon as Visual Studio saved it before a compile. The compiler then tried to access the file and would find it locked by MSE. Adding the Visual Studio projects directory to the exclusions list made the error go away.