I had this issue and all the solutions online was kind of misleading to my issue. I have the solution here.
http://dotnet-programming-solutions.blogspot.com/2012/10/attach-database-encountered-operating.html
The solution was to Run SSMS as Administrator.