Today I upgrade my DNN from 3.1.0 to 3.2.2.
It's all right, but a little problem about web.config.
Steps:
1. Backup my dotnetnuke folder to another place.
2. Backup dotnetnuke database.
3. Unzip the source code of DNN 3.2.2 into dotnetnuke folder and replace dnn 311 files.
4. Open Web.config edit connectionstring part. Just paste the line from my backup folder.
5. Open IE run http://localhost/dotnetnuke/default.aspx to run update code.
DNN core team changed the implementation of UserProfile class. In DNN 310, they use private member to store each property.
In DNN 310 a property named 'City' will look like this:
Private _profileProperties As System.Collections.Hashtable
The good side of Hashtable is UserController object can fill this object through a For each thing.
In FillUserProfile:
Try
u.City = Convert.ToString(objProfile("City"))
Catch
End Try
Try
u.Country = Convert.ToString(objProfile("Country"))
Catch
End Try

.
So obviously the Usercontroller is clear now in DNN322.
It's all right, but a little problem about web.config.
Steps:
1. Backup my dotnetnuke folder to another place.
2. Backup dotnetnuke database.
3. Unzip the source code of DNN 3.2.2 into dotnetnuke folder and replace dnn 311 files.
4. Open Web.config edit connectionstring part. Just paste the line from my backup folder.
5. Open IE run http://localhost/dotnetnuke/default.aspx to run update code.
DNN core team changed the implementation of UserProfile class. In DNN 310, they use private member to store each property.
In DNN 310 a property named 'City' will look like this:
Private _City as string
Public Property City() as string
Get
Return _City
End Get
Set(ByVal Value as string)
_City= Value
End Set
End Property
And now, they use Hash table. Public Property City() as string
Get
Return _City
End Get
Set(ByVal Value as string)
_City= Value
End Set
End Property
Private Const cCity As String = "City"
Public Property City() As String
Get
If _profileProperties.ContainsKey(cCity) = False OrElse _profileProperties(cCity) Is Nothing Then Return Null.NullString
Return _profileProperties(cCity).ToString()
End Get
Set(ByVal Value As String)
SetProfileProperty(cCity, Value)
If Not ObjectHydrated Then
ObjectHydrated = True
End If
End Set
End Property
_profileProperties is the Hash table:Public Property City() As String
Get
If _profileProperties.ContainsKey(cCity) = False OrElse _profileProperties(cCity) Is Nothing Then Return Null.NullString
Return _profileProperties(cCity).ToString()
End Get
Set(ByVal Value As String)
SetProfileProperty(cCity, Value)
If Not ObjectHydrated Then
ObjectHydrated = True
End If
End Set
End Property
Private _profileProperties As System.Collections.HashtableThe good side of Hashtable is UserController object can fill this object through a For each thing.
In FillUserProfile:
For Each o As AspNetProfile.SettingsProperty In AspNetProfile.ProfileBase.Properties
u.ProfileProperties.Add(o.Name, objProfile.Item(o.Name))
Next
And In DNN 310, each property have to be set by Try ... Catch thing.u.ProfileProperties.Add(o.Name, objProfile.Item(o.Name))
Next
Try
u.City = Convert.ToString(objProfile("City"))
Catch
End Try
Try
u.Country = Convert.ToString(objProfile("Country"))
Catch
End Try
.
浙公网安备 33010602011771号