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.
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 TobischDNN★MVP
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.
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.
INavigationManager.NavigateURL
INavigationManager
Hope it helps!
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'
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.
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.
Reference Include="netstandard"
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?
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.