Using VS2010 code first and SQL Server 2008r2 with an MVC3 webapp, the SetInitializer creates a db as expected when missing or on model changes.
The db created has the filename format database.mdf and the **logfile database.ldf (can this default "name.ldf" format be changed to "name_log.ldf"?).
When opening the database with VS2010 server explorer (double-clicking the db in solution explorer), the VS2010 creates a new second logfile formatted database_log.ldf.
I can now browse the database in VS2010 server explorer, but can no longer debug, dropcreateonmodelchange or otherwise use the db.
When trying to debug error shown is: {"One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup.\r\nCannot open database \"database\" requested by the login. The login failed.\r\nLogin failed for user 'My-PC\Me'.\r\nLog file 'C:\Users\Me\project\App_Data\database.ldf' does not match the primary file. It may be from a different database or the log may have been rebuilt previously."} ...which is fair enough since the project is expecting the current log file to be "database.ldf".
The ASPNETDB.MDF and aspnetdb_log.ldf files/names are also created and don't have the default log file name issue, so the issue doesn't apply to ASPNETDB.
Is it possible to change the default log file name for the SetInitializer to create a "database_log.ldf" formatted log file name instead of the "database.ldf"? I've googled without success, and looked at all the settings and options I could find in VS2010. Is the format stored in a config file somewhere that can be hand edited?