Thursday 21 February 2008

ProfileBase.Save() doesn't save any changes after deployed on server

I have this method to save all the changes to current profile (because I am using Membership security by ASP.net 2 ). you first call

ProfileBase currentProfile = ProfileBase.Create(username);

in a separate class library and then we call ProfileBase.Save() to save the changes we made in the form. This will be all fine when the code is running on my local development server, but once I put it on staging/testing server, this won't save any changes I made. The reason is because Membership will treat this two version as two separate web applications regardless what you specified in provider application name of the web.config file. Users created in one application will still be able to log in in another application, but the profile data for that user won't be shown because it's not the same application. So I do it in webroot level instead of class library, I would be able to get hold of ProfileCommon class and the save method in that works fine on . But still this will just be a imperfect solution for the problem we have. I wonder if there's anything we can do to specify the application name in run time...

No comments: