我最近将我的 DNN 版本从 7.3.4 升级到 9.9。当我编译我的解决方案时,我收到以下警告:
[Obsolete("Deprecated in 9.7.2。计划在 v11.0.0 中删除,请改用 DotNetNuke.Abstractions.Portals.IPortalAliasInfo.HttpAlias。")]
我尝试实现 IPortalAlaiasInfo,但没有成功。我查看了 DNN 的启动文件,看到了以下服务:
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<WebFormsModuleControlFactory>();
services.AddSingleton<Html5ModuleControlFactory>();
services.AddSingleton<ReflectedModuleControlFactory>();
services.AddSingleton<IDnnContext, DotNetNukeContext>();
services.AddScoped<IEventLogger, EventLogController>();
services.AddScoped<IEventLogConfigService, EventLogController>();
services.AddScoped<IEventLogService, EventLogController>();
services.AddTransient((IServiceProvider x) => ServiceLocator<IPortalController, PortalController>.Instance);
services.AddScoped<IHostSettingsService, HostController>();
services.AddScoped<INavigationManager, NavigationManager>();
services.AddScoped<ISerializationManager, SerializationManager>();
services.AddScoped<IApplicationInfo, DotNetNuke.Application.Application>();
services.AddScoped<IApplicationStatusInfo, ApplicationStatusInfo>();
services.AddScoped<IPortalAliasService, PortalAliasController>();
}
Run Code Online (Sandbox Code Playgroud)
我没有看到对接口 IPortalAliasInfo 的引用。
有谁知道如何访问 DotNetNuke.Abstractions.Portals.IPortalAliasInfo.HttpAlias?如果是这样,你能不能提供一个例子?
谢谢你。