c# - Server Explorer shows both dbContext and database.mdf active -
i may have confused implementation of database asp.net mvc project, have separate data layer connection string pointed .mdf
file.
i imported data models through ado.net entity data model code-first existing database.
when go enable migrations, no problem.
however, i'm trying add-migration
, , get:
unable generate explicit migration because following explicit migrations pending: [201504081848445_initialcreate].
i checked server explorer, , noticed have both "databasecontext" , database.mdf
showing up. sorry if elementary question, suspicion has connection string? saw when first enable , create migrations, show in databasecontext
. next day, see "databasecontext" missing _migrationhistory
, , see error message explicit migrations pending.
my connection string:
<connectionstrings> <add name="databasecontext" connectionstring="data source=(localdb)\v11.0;attachdbfilename=|datadirectory|\database.mdf;integrated security=true;multipleactiveresultsets=true;app=entityframework" providername="system.data.sqlclient" /> </connectionstrings>
edit 1 i'm having trouble enabling , updating database migrations. i've re-imported data model code-first, , re-enabled migrations.
i see databasecontext contains table _migrationhistory, , nothing else. .mdf has tables except _migrationhistory.