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)

Sort:
You are not authorized to post a reply.





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





      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.

      Hope it helps!

      DNN partner specializing in custom, enterprise DNN development https://engagesoftware.com/showcase





      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





          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.

          DNN partner specializing in custom, enterprise DNN development https://engagesoftware.com/showcase
          You are not authorized to post a reply.

          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:

          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