Thanks again for your reply Aderson. I ended up taking a different approach to finally get it working.
The issue is with the version of DNN I'm using (8.0.4). Apparently somewhere along the way the UpdateUserProfile method on the ProfileController was broken. I was able to track someone down with a similar issue to mine in this post. What fixed it for him did not 100% work for me. It would let me set a property once then it wouldn't function anymore. Same problem. However what I did was take his approach and go straight to the source code which I obtained from github. What I found was if you use a specific overload of the UpdateUserProfile after clearing both the portal cache and 'general' cache it works. The working method takes a UserInfo object and ProfilePropertyDefinitionCollection object. This is a known bug and will be fixed in DNN9. I'll post working code for anyone who may run across this issue:
// property is an object with a 'Name' and 'Value' property that contains the name of the property to update and the value to set it to.
var user = UserController.GetUserById(PortalSettings.PortalId, UserId);
var properties = new ProfilePropertyDefinitionCollection();
var userprofile = UserInfo.Profile;
var toUpdate = userprofile.GetProperty(property.Name);
// this will set the value on the user object
toUpdate.PropertyValue = property.Value;
foreach (ProfilePropertyDefinition profProperty in userprofile.ProfileProperties)
{
properties.Add(profProperty);
}
// both caches must be cleared before you attempt to update
DataCache.ClearPortalCache(PortalSettings.PortalId, true);
DataCache.ClearCache();
// other overloads of this method were broken in Dnn8 so you must use this overload
DotNetNuke.Entities.Profile.ProfileController.UpdateUserProfile(user, properties);
Hope this stops someone. Thanks.