Code First Migrations error

Sep 5, 2012 at 7:08 PM

Hi there,

I'm using the Seed method within configuration.cs that's created when you turn on Code First Migrations in an ASP.Net MVC project.

All my usual 'context.ENTITYHERE.AddOrUpdate' calls are working great. The problem comes when I attempt to setup some users with this membership provider:

Could not load type 'CodeFirstMembershipSharp.CodeFirstMembershipProvider' from assembly 'System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

If I disable the 'Membership.CreateUser(Username, Password, Email, null, null, IsApproved, null, out CreateStatus);' line in WebSecurity.cs, it appears to be ok..!

Any ideas? Any help much appreciated!

Sep 8, 2012 at 6:21 PM

Check the seed method in the context initializer, and move that to migrations seed.

Apr 25, 2013 at 11:45 AM
It seems calling migrations Seed method from package manager console with Update-Database results to this error. I have the same problem.