I think your type string is missing .
:
<databaseInitializer type="System.Data.Entity.MigrateDatabaseToLatestVersion">
The red box above the code makes it difficult to read ...
If you fix this, post a comment and I’ll prepare a sample to match yours and see if I can make it work ...
[UPDATED 2012-08-15]
OK. I think I know what is going on here ... You mentioned "I updated my web.config to have this:" and showed your XML. When I looked through the tutorial, I didn't have to inject ANY additional XML into my web.config
. During the publishing process, XML was automatically added for me using the Visual Studio deployment process, and it all “just worked.”
Here is your solution:
Revert to the original web.config
without these updates and republish.
For reference, here are the <entityFramework>
sections from my two web.config
files, first from my project, the second from my hosted service (I got this by connecting to a working site via FTP and downloading it). The VS project is called 11964172
after the SO record number for this message:
local web.config
options
<entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <parameters> <parameter value="v11.0" /> </parameters> </defaultConnectionFactory> </entityFramework>
deployed web.config
options
<entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <parameters> <parameter value="v11.0" /> </parameters> </defaultConnectionFactory> <contexts> <context type="_11963331.Models.ToDoDb, 11963331"> <databaseInitializer type="System.Data.Entity.MigrateDatabaseToLatestVersion`2[[_11963331.Models.ToDoDb, 11963331], [_11963331.Migrations.Configuration, 11963331]], EntityFramework, PublicKeyToken=b77a5c561934e089"> <parameters> <parameter value="_11963331.Models.ToDoDb_DatabasePublish" /> </parameters> </databaseInitializer> </context> </contexts> </entityFramework>
I think this explains why they took a snapshot of the changes to the web.config
instead of actually providing the code for input :-)