Frank Cannon
Frank Cannon

Reputation: 1751

Getting Error Using Microsoft.AspNet.Membership.OpenAuth

I am getting an error using the RegisterExternalLogin control from the Visual Studio templates. After choosing login from Twitter, Twitter seems to process the login ok and then tries to load the response page and then the error occurs.

The error seems to be related to EntityFrameworks after the login method being called from the Microsoft.Aspnet.Membership.OpenAuth dll but that's about all I know.

Does anybody know how to resolve this?

Here is the error message:

[MissingMethodException: Method not found: 'System.Data.Objects.ObjectContext System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()'.] Microsoft.AspNet.Membership.OpenAuth.EFOpenAuthMembershipDatabase.EnsureDatabaseCreated(DbContext db) +0
Microsoft.AspNet.Membership.OpenAuth.EFOpenAuthMembershipDatabase.GetMembershipUserName(String providerName, String providerUserId, Boolean updateLastUsed) +221
Microsoft.AspNet.Membership.OpenAuth.OpenAuthManager.Login(HttpContextBase context, String providerName, String providerUserId, Boolean createPersistentCookie) +128
Microsoft.AspNet.Membership.OpenAuth.OpenAuth.Login(String providerName, String providerUserId, Boolean createPersistentCookie) +198 FinModelControls.Account.RegisterExternalLogin.ProcessProviderResult() +594

Upvotes: 1

Views: 2312

Answers (1)

Dizzy
Dizzy

Reputation: 902

Having similar exception, submitted a Conect bug. https://connect.microsoft.com/VisualStudio/feedback/details/811035/microsoft-aspnet-membership-openauth-is-not-compatible-with-entity-framework-6

Solution: Make sure you're using latest v 2.0.0 Microsoft.AspNet.Membership.OpenAuth package, not 1.0.1.

Upvotes: 1

Related Questions