The MSDN documentation for SQLEXPRESS says:
When an application first establishes a connection from a running instance of SQL Server Express, SQL Server Express will automatically attach an .mdf file. When the user closes the application, SQL Server Express detaches the .mdf file from the instance.
This does not appear to be happening. If I replace the MDF file with a new one of the same name (after deleting the log file, of course) SQL Server Express will refuse to attach it.
I've tried just about every combination of connection string parameters possible, and it's driving me crazy. Any suggestions?