DNN Forums

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

Upgrading from 9.1.1 to 9.4.4 and Globals.NavigateURL

Sort:
You are not authorized to post a reply.
Page 1 of 212 > >>





New Around Here





    I am planning to upgrade my DNN site (WebForms) from 9.1.1 to 9.4.4. I am doing a test run on local machine. After I upgraded I see the following warning when I compiled my custom modules. Going to NaviagateURL documentation doesn't give any information on what replaced it. What replaced it?

    Globals.NavigateURL(int, string, params string[])' is obsolete: 'Deprecated in Platform 9.4.2. Scheduled removal in v11.0.0.






    Veteran Member





      Ana,

      I had the same "problem". Please refer to this forum post - it should give you the answer...

      Don't hesitate to ask if you have further questions.

      Happy DNNing!
      Michael

      Michael Tobisch
      DNN★MVP

      dnnWerk Austria
      DNN Connect





      New Around Here





        Posted By Michael Tobisch on 29 Feb 2020 10:59 AM

        Ana,

        I had the same "problem". Please refer to this forum post - it should give you the answer...

        Don't hesitate to ask if you have further questions.

        Happy DNNing!
        Michael

        Thanks Michael for the reply. The link you added points to this post itself. Can you please send me the right one.

         

         






        Advanced Member





          Ana, I believe that post is https://dnncommunity.org/forums/aft/794. The short version is to use INavigationManager.NavigateURL instead. You'll need to use Dependency Injection to access an implementation of the INavigationManager interface.

          Hope it helps!

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





          New Around Here





            Posted By Brian Dukes on 02 Mar 2020 09:26 AM

            Ana, I believe that post is https://dnncommunity.org/forums/aft/794. The short version is to use INavigationManager.NavigateURL instead. You'll need to use Dependency Injection to access an implementation of the INavigationManager interface.

            Hope it helps!

            Thanks Brian! I am trying get the example you pointed compile and I am getting errors about netstandard. What am I missing?

            CS0012    The type 'IServiceProvider' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

             

             






            Advanced Member





              You'll need to make sure your project is referencing .NET 4.7.2 (or later), and that you have the right version of the DotNetNuke.Abstractions and DotNetNuke.DependepcyInjection NuGet packages.
              DNN partner specializing in custom, enterprise DNN development https://engagesoftware.com/showcase





              New Around Here





                Posted By Brian Dukes on 02 Mar 2020 11:36 AM
                You'll need to make sure your project is referencing .NET 4.7.2 (or later), and that you have the right version of the DotNetNuke.Abstractions and DotNetNuke.DependepcyInjection NuGet packages.

                I have the following in packages.config (site is not letting me copy paste the config file contents):
                 

                  DotNetNuke.Core, version 9.4.0.156-alpha, targetFramework net472
                  DotNetNuke.DependencyInjection, 9.4.0.156-alpha, net472
                  Microsoft.Extensions.DependencyInjection, 2.1.1, net472
                 icrosoft.Extensions.DependencyInjection.Abstractions, 2.1.1, net472

                And target framework is .NET Framework 4.7.2.

                 






                Advanced Member





                  You'll want to reference the 9.4.4 packages for DNN.  According to https://github.com/dotnet...uecomment-349163872, you may need to update Visual Studio, and it may help to add a Reference Include="netstandard" line into your project file.

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





                  New Around Here





                    Posted By Brian Dukes on 02 Mar 2020 12:07 PM

                    You'll want to reference the 9.4.4 packages for DNN.  According to https://github.com/dotnet...uecomment-349163872, you may need to update Visual Studio, and it may help to add a Reference Include="netstandard" line into your project file.

                    Thanks Brian, I updated my Visual Studio and everything compiles fine. But, I use Globals.NavigateURL in schedulers which don't extend PortalModuleBase. Also, in few of the modules we have a static methods which return the URL using Globals.NavigateURL, which can be accessed both by Schedulers, ascx. Is there a way to get hold of INavigationManager instance in these scenarios?

                     

                     






                    Advanced Member





                      Ana, there doesn't appear to be a way in DNN 9.5.0 for you to access an INavigationProvider instance from a scheduled task. Thank to your post, we'll investigate and provide a resolution. You can follow progress at https://github.com/dnnsof...Platform/issues/3602
                      DNN partner specializing in custom, enterprise DNN development https://engagesoftware.com/showcase
                      You are not authorized to post a reply.
                      Page 1 of 212 > >>

                      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