I ran into the following error when attempting to run ‘update-database’ on an initial migration:
Cannot attach the file ‘C:Users…App_Dataaspnet-…115933.mdf’ as database ‘aspnet-…15933’
The solution to this one is pretty easy, remove the initial catalog property from your connection string.
This is apparently caused by issues with EntityFramework and multiple projects in the same database. See the following stackoverflow answer for more info: https://stackoverflow.com/a/20176660/522859
Leave a Reply