Copying project does not retain entity framework connection

4318 views c#

I'm moving my project from one machine to another. I simply zipped the project folder and moved it to my new computer. My project is an asp .net mvc application with entity framework. I have my connection string in my webconfig file. When I run my application on my new machine, it has trouble connecting to the database it seems.

I get this message when trying to create a dbcontext [SqlException (0x80131904): There is already an object named 'Merchandises' in the database.]

But the odd thing is it runs perfectly fine on my old machine.

I executed add-migration command and it says i'm very behind in migrations but this is not true.

Unable to generate an explicit migration because the following explicit migrations are pending: [201802070210548_Initial_Migration, 201802130149472_Added_TrackForm, 201802181945057_Added_DOB]. Apply the pending explicit migrations before attempting to generate a new explicit migration.

Any assistance for debugging this would be greatly appreciated.

answered question

1 Answer


Ditch EF migration. Handle db updates yourself in SSMS.

posted this

Have an answer?


Please login first before posting an answer.