8
I'm writing a MVC4 Website using Microsoft Visual Studio express 2012 for web. Whenever I run "Update-Database" in the Package Manager Console, the following Exception occurs:
To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider".
This is my Seed method:
protected override void Seed(GNSystem.Models.DataContext context)
{
context.Forums.AddOrUpdate(
new Forum { ForumName = "Hello" },
new Forum { ForumName = "World" },
new Forum { ForumName = "!" }
);
context.UserProfiles.Add(new UserAccount { UserName = "Gilad", EMail = "user@example.com" });
WebSecurity.CreateUserAndAccount("Gilad", "123456");
WebSecurity.Login("Gilad", "123456");
context.Threads.AddOrUpdate(
new Thread { Subject = "FirstThread", Content = "Awesome Content", ForumID = 1, UserID = 1 },
new Thread { Subject = "SecondThread", Content = "Awesome Content", ForumID = 1, UserID = 1 }
);
}
I searched for solutions and added the following directive in the Web.config file:
<add key="enableSimpleMembership" value="true" />
but the exception is thrown nonetheless.
What is the cause of this? Edit 1:
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For mor