You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Teams building a WebForms-pattern module (.ascx/code-behind) on DNN Platform 10.x, targeting .NET Framework 4.8, and want to use real constructor injection rather than a static service-locator pattern for module dependencies. Since .NET Framework 4.7.2, System.Web.HttpRuntime.WebObjectActivator allows true constructor injection into Page/UserControl/MasterPage. Before teams adopt it, they wouldwant to check DNN's official guidance and current status directly.
The current DI docs cover MVC, Razor3, and SPA/Web API modules — is there an equivalent, officially recommended pattern for getting constructor injection specifically into a classic WebForms module's UserControl code-behind via WebObjectActivator, or is property/setter injection still the supported approach for that module pattern?
Does ModuleControlPipeline/IModuleControlPipeline interact with WebObjectActivator in a way teams should account for, or are they unrelated mechanisms that happen to both be part of the DI story?
For reference, the shape of wiring I have evaluated is the same as Microsoft's own (now-retired, reference-only) AspNetWebFormsDependencyInjection sample - setting HttpRuntime.WebObjectActivator from Application_Start via a small IServiceProvider adapter over the container. Is that general
approach (regardless of container) known to be compatible with DNN's module activation, or is there a DNN-specific gotcha we should know about first?
Last reference - I co-created PicoContainer for Java before Depencency Injection was called that. Later, Unity container methods looked a lot like PicoContainer;s ones.
TL;DR: Current D.I best-practice codified in a how-to page would be fantastic :) :)
Is there an existing issue for this?
Description of problem
Teams building a WebForms-pattern module (
.ascx/code-behind) on DNN Platform 10.x, targeting .NET Framework 4.8, and want to use real constructor injection rather than a static service-locator pattern for module dependencies. Since .NET Framework 4.7.2,System.Web.HttpRuntime.WebObjectActivatorallows true constructor injection intoPage/UserControl/MasterPage. Before teams adopt it, they wouldwant to check DNN's official guidance and current status directly.DotNetNuke.ModulePipeline/ModuleControlPipelinework) that an initial attempt at usingWebObjectActivatorcaused crashes, possibly related toClientDependency. Has that been root-caused and resolved? IsWebObjectActivator-based construction considered safe for DNN module activation today?UserControlcode-behind viaWebObjectActivator, or is property/setter injection still the supported approach for that module pattern?ModuleControlPipeline/IModuleControlPipelineinteract withWebObjectActivatorin a way teams should account for, or are they unrelated mechanisms that happen to both be part of the DI story?AspNetWebFormsDependencyInjectionsample - settingHttpRuntime.WebObjectActivatorfromApplication_Startvia a smallIServiceProvideradapter over the container. Is that generalapproach (regardless of container) known to be compatible with DNN's module activation, or is there a DNN-specific gotcha we should know about first?
TL;DR: Current D.I best-practice codified in a how-to page would be fantastic :) :)
Sources
Pipeline
Modules
Description of solution
Markdown page talking about pattern and linking to tight example code (or project)
Description of alternatives considered
Briefly considered ServiceLocator and Singleton (dssign patterns) but the last 26 years of my career have been spent arguing against those!
Anything else?
No response
Do you plan to contribute code for this enhancement?
Would you be interested in sponsoring this enhancement?
Code of Conduct