Try checking your web.config and make sure you have a valid defaultMemberTypeAlias on your membership provider (system.web/membership - on UmbracoMembershipProvider). If it's not valid you'll get the above exception. I think it's this bug on codeplex.
If you have only one member type defined at all - then you can just remove this parameter from the web.config completely - in this case this member type will be picked up for a new member automatically.
Exception thrown on creating a new member
I'm using Umbraco 4.7.1 and want to create a new member from within my code.
on the trigger of an event I am calling the Membership.CreateUser with valid parameters
but the function generates a Null refererece exception further down the stack.
What would be causing this?
Thanks,
Matt
Hi Matt,
Try checking your web.config and make sure you have a valid defaultMemberTypeAlias on your membership provider (system.web/membership - on UmbracoMembershipProvider). If it's not valid you'll get the above exception. I think it's this bug on codeplex.
HTH,
Tom
Hi. Are all parameters of your first call set to not null?
Thanks Tom,
Spot on, I had been sloppy and missed the defaultMemberTypeAlias!
Thanks,
Matt
If you have only one member type defined at all - then you can just remove this parameter from the web.config completely - in this case this member type will be picked up for a new member automatically.
Thanks Rodion, I didn't know you could do that
is working on a reply...