Hi,
We just migrated from 9.1. to DNN 9.2.2
I get the following errors : 1) Method not found: 'System.String DotNetNuke.Entities.Modules.ModuleInfo.get_Version()' 2) Method not found: 'System.String[] DotNetNuke.Security.Roles.RoleController.GetRolesByUser(Int32, Int32)'.
I read that DNN 9.2.2 has over 500 depricated methods removed. But how do I replace these methods with ?There are no suggestions in Visual Studio(I am using old version -VS 2013) I am working on Calendar Events(FlexEvents). Please let me know if I am not clear. Thank you for your time in advance.
Thanks.
If you compile against 9.1.1, you should see deprecation warnings (the members are totally removed in 9.2, so there's nowhere to include a message once you're compiling against a later version).
Looking at the 9.1.1 version of the platform, ModuleInfo.Version says Deprecated in DNN 5.0. Replaced by by DesktopModule.Version. RoleController.GetRolesByUser does not have a migration suggestion in its deprecation message (it's just Deprecated in DotNetNuke 6.2.), but the implementation is this: UserId == -1 ? new string[0] : UserController.GetUserById(PortalId, UserId).Roles, so it looks like the intention is to retrieve them via the UserInfo object.
ModuleInfo.Version
Deprecated in DNN 5.0. Replaced by by DesktopModule.Version
RoleController.GetRolesByUser
Deprecated in DotNetNuke 6.2.
UserId == -1 ? new string[0] : UserController.GetUserById(PortalId, UserId).Roles
UserInfo
Hope it helps!
Hi Brian,
Thank you very much for the reply. Your second solution worked for me. For the first solution, when I write DesktopModule.Version, I get error that "DesktopModule does not exist in the current context" .Is there any dll i have to add to use this ?
The line where I get error is :
var objVersion = Version.Parse(ModuleContext.Configuration.Version); Thanks
On the ModuleInfo object (ModuleContext.Configuration), use the DesktopModule property to access the related DesktopModuleInfo, and then you'll be able to get to the Version property. Alternatively, use the DesktopModuleController class to get a DesktopModuleInfo instance without a ModuleInfo.
ModuleInfo
ModuleContext.Configuration
DesktopModule
DesktopModuleInfo
DesktopModuleController
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.