DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Errors of method not found for DNN 9.2.2 (Depricated methods)

 3 Replies
 1 Subscribed to this topic
 21 Subscribed to this forum
Sort:
Author
Messages
New Around Here
Posts: 8
New Around Here

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.

Advanced Member
Posts: 159
Advanced Member
MVP
MVP
You're an MVP!

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, <code>ModuleInfo.Version</code> says Deprecated in DNN 5.0. Replaced by by DesktopModule.Version. <code>RoleController.GetRolesByUser</code> does not have a migration suggestion in its deprecation message (it's just Deprecated in DotNetNuke 6.2.), but the implementation is this: <code>UserId == -1 ? new string&#91;0&#93; : UserController.GetUserById(PortalId, UserId).Roles</code>, so it looks like the intention is to retrieve them via the <code>UserInfo</code> object.

Hope it helps!

New Around Here
Posts: 8
New Around Here

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

Advanced Member
Posts: 159
Advanced Member
MVP
MVP
You're an MVP!

On the <code>ModuleInfo</code> object (<code>ModuleContext.Configuration</code>), use the <code>DesktopModule</code> property to access the related <code>DesktopModuleInfo</code>, and then you'll be able to get to the property.  Alternatively, use the <code>DesktopModuleController</code> class to get a <code>DesktopModuleInfo</code> instance without a <code>ModuleInfo</code>.

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved