Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publish Web dialog doesn't detect my entity framework 5 context as Code First

I've recently upgraded a WFC project that uses Entity Framework from v4.3.1 to 5.0.
I'm running Coded migrations only (no automatic migrations).

Previously, I was using the Publish Profiles to deploy this solution and apply the migrations. Since upgrading the project to EF5, the migrations portion no longer works and the publish dialog doesn't detect the context as having code-first migrations.

Specifically, the .pubxmlfile changed from detecting my context as <Object Type="DbCodeFirst">to <Object type="DbDacFx"> which is incorrect for my context.

As a workaround, I've manually added the <entityFramework> database initializer configuration to my web.config transforms, but I'd like to understand why the publish profiles aren't working. That was a much nicer solution.

like image 239
Josh Avatar asked Sep 20 '12 14:09

Josh


1 Answers

It once happened on me when merging another developer's commit and triggered Visual Studio project reload. That's how it caused the "DbCodeFirst" to "DbDacFx" change.

If I restart Visual Studio then everything goes back to what it should be.

Just another thought.

like image 147
Xinan Avatar answered Nov 16 '22 15:11

Xinan