Visual Studio build fails: unable to copy exe-file from obj\debug to bin\debug

This is going to sound stupid, but I tried all these solutions, running VS2010 on Windows 7. None of them worked except the renaming and building, which was VERY tedious to say the least. Eventually, I tracked down the culprit, and I find it hard to believe. But I was using the following code in AssemblyInfo.cs…

[assembly: AssemblyVersion("2.0.*")]

This is pretty common, but for some reason, changing the version to 2.0.0.0 made things work again. I don’t know if it’s a Windows 7 specific thing (I’ve only been using it for 3-4 weeks), or if it’s random, or what, but it fixed it for me. I’m guessing that VS was keeping a handle on each file it generated, so it would know how to increment things? I’m really not sure and have never seen this happen before. But if someone else out there is also pulling their hair out, give it a try.

Leave a Comment