Try our conversational search powered by Generative AI!

Default Membership Provider must be specified error when deleting Contact (Commerce 10.8)


We've been experiencing errors when deleting users since moving to ASP.NET Identity. We are able to delete the user using the UserManager just fine, but cannot delete the contacts. We get the following exception since implementing ASP.NET Identity in the same fashion as described here.

[ProviderException: Default Membership Provider must be specified.]
   System.Web.Security.Membership.InitializeDefaultProvider(Boolean initializeDefaultProvider, MembershipSection settings) +10174203
   System.Web.Security.Membership.Initialize() +455
   System.Web.Security.Membership.get_Provider() +9
   System.Web.Security.Membership.GetUser(String username, Boolean userIsOnline) +41
   Mediachase.Commerce.Customers.CustomerContext.GetUserForContactId(PrimaryKeyId customerContactId) +164
   Mediachase.Commerce.Customers.Handlers.ContactRequestHandler.PreDelete(BusinessContext context) +211
   Mediachase.BusinessFoundation.Data.Business.EntityObjectDefaultRequestHandler.PreExecute(BusinessContext context) +612
   Mediachase.BusinessFoundation.Data.Business.BaseRequestHandler.Mediachase.BusinessFoundation.Data.Business.IRequestHandler.PreExecute(BusinessContext context) +51
   Mediachase.BusinessFoundation.Data.Business.BusinessManager.Execute(Request request) +496
   Mediachase.BusinessFoundation.Data.Business.BusinessManager.Delete(EntityObject entityObject) +72
   EPiServer.Reference.Commerce.Site.Features.Login.Controllers.LoginController.DeleteUsers() in C:\dev\Quicksilver\Sources\EPiServer.Reference.Commerce.Site\Features\Login\Controllers\LoginController.cs:75

The code in question was added to Quicksilver LoginController Index to confirm that it wasn't a configuration issue in my project. The Guid for the contact of a new user I created from the admin area on Quicksilver. Nothing else has been modified from Quicksilver 10.8.

        private void DeleteUsers()
            var myGuid = new Guid("128ED95A-6D32-4745-9930-F3BA8A7CC502");
            var contact = CustomerContext.Current.GetContactById(myGuid);
            if (contact != null)

Is there a fix for this or anything I should be doing differently? I noticed another post with this error, but during authentication and not deletion. There is no follow up post either with a resolution.

Edited, Sep 22, 2017 23:36

It should catch the ProviderException.  You can remove ContactRequestHandler in to see if that helps but you will need to cleanup related references manually

Sep 28, 2017 1:13

I don't think the exception is handled in PreDelete. Sounds like a bug for me. I will file a report and we will look into it.

Sep 28, 2017 8:29

Thanks Quan.

Sep 29, 2017 15:52

This bug (COM-5516) is fixed, and will be released in Commerce 11.3

Oct 11, 2017 12:05

Thanks Quan. Any idea when that will be released?

Oct 19, 2017 17:26

11.3.0 is under testing right now and will probably be released the week after next week :)

Oct 19, 2017 19:30
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.