• Login
  • Register

DNN Forums

A community discussion page. We're starting from scratch, so...let's get the party started!

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

You are not authorized to post a reply.
Sort:


New Member


Posts:8
New Member

    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.



    Basic Member


    Posts:67
    Basic 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 Member


      Posts:8
      New Member

        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



        Basic Member


        Posts:67
        Basic 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 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. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
          2. 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.
          3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
          4. No Flaming or Trolling.
          5. No Profanity, Racism, or Prejudice.
          6. Site Moderators have the final word on approving / removing a thread or post or comment.
          7. 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