When starting a new project that required the use of membership providers I found that I could not connect to a remote database that contained the membership database.
I needed to add this lines to get my Roles and Profile staff based on Membership class working: