How to delete a SimpleMembership user?

后端 未结 5 1698
野的像风
野的像风 2020-12-28 21:25

In my ASP.NET MVC app using Forms Authentication (via SimpleMembership), how do I delete a user/account?

The WebSecurity class doesn\'t expose DeleteUser. On a lark

5条回答
  •  Happy的楠姐
    2020-12-28 22:10

    I was getting the exception System.NotSupportedException from Membership.DeleteUser when running my unit tests. The problem was the app.config had the "DefaultProvider" set to "ClientAuthenticationMembershipProvider", which as you can see here is "not used by this class".

    The fix was to update my app.config to match my web.config and properly configure the default provider:

    
        
            
                
            
        
    

提交回复
热议问题