Ryan Ryan - 1 year ago 123
ASP.NET (C#) Question

Hot to get UserInfo in DNN7 - GetCurrentUserInfo is deprecated

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..."

Answer Source

Change all entries from



Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download