2

I have been using GetCurrentUserInfo up until now but my company is moving to DNN 7.3 and some of our modules use this method to get the userInfo for the current user.

Dim userInfo As DotNetNuke.Entities.Users.UserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo()

When building for DNN 7.3 we are now getting a warning:

Warning BC40000 'Public Shared Overloads Function GetCurrentUserInfo() As UserInfo' is obsolete: 'Deprecated in DNN 7.3. Replaced by UserController.Instance.GetCurrentUserInfo()'. 

What is the correct current way to get the same UserInfo? I have tried following the warning's advice but I still get the same warning : "GetCurrentUserInfo() As UserInfo' is obsolete..."

Agamemnon
  • 587
  • 2
  • 15
  • 44
  • When I change from `DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo()` to `DotNetNuke.Entities.Users.UserController.Instance.GetCurrentUserInfo()` there are no issues. Are you sure you changed all of the old references? – VDWWD Aug 03 '16 at 14:06
  • @VDWWD - Well that's odd, the references looked fine but I followed your advice and deleted/re-added them, cleaned, rebuilt and it seems to be fine now. You can put that as an answer and I'll mark it as the working answer. – Agamemnon Aug 03 '16 at 14:22

1 Answers1

3

Change all entries from

DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo()

to

DotNetNuke.Entities.Users.UserController.Instance.GetCurrentUserInfo()
VDWWD
  • 35,079
  • 22
  • 62
  • 79