Needs to be a Web Site project
I found out you need to make this a Web Site project, not a regular web application project, in order for this to work.
I'm still having problems with this code though. It's telling me Page.User.Identity.IsAuthenticated is false, so I cannot enter the bit of code that assigns Profile.FirstName, etc.
If I remove the check for IsAuthenticated, I get the error message "The profile default provider was not found."