Search code examples
angularjsvb.netdotnetnuke

DNN ModuleID not being passed from the code behind to the ascx


Backstory: I use a DNN (DotNetNuke) content management system to host VB.NET/Angular1 modules.

I'm currently having an issue where a value in the code-behind is not accessible in the View.ascx of my module. This is causing a fatal runtime error.

The code behind where the value is being passed to a publicly defined variable

The View.ascx where the variable is being used

Erreur: icod est présentement indisponible. 
DotNetNuke.Services.Exceptions.ModuleLoadException: C:\inetpub\wwwroot\FRANCO-NORD-www1\DesktopModules\icod\View.ascx(2): error BC30451: 'modID' n'est pas déclaré. Il peut être inaccessible en raison de son niveau de protection. ---> System.Web.HttpCompileException: C:\inetpub\wwwroot\FRANCO-NORD-www1\DesktopModules\icod\View.ascx(2): error BC30451: 'modID' n'est pas déclaré. Il peut être inaccessible en raison de son niveau de protection.
à System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
à System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
à System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
à System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
à DotNetNuke.UI.ControlUtilities.LoadControl[T](TemplateControl containerControl, String ControlSrc)
à DotNetNuke.UI.Modules.WebFormsModuleControlFactory.CreateModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration)
à DotNetNuke.UI.Modules.ModuleControlFactory.LoadModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration)
à DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() --- Fin de la trace de la pile d'exception interne --

I noticed that they reference View.ascx(2) as if there are two physical versions of the file in the project or on the server, but this is not the case.

Any ideas on what may be going on here? Please let me know should the post require additional information.


Solution

  • I've resolved the issue by rebuilding my local development instance of DNN to a version higher than that of the production instance and rebuilt the module. I believe one of the DLLs we use in our environment, PetaPoco was causing an issue when the module was installed on a lower version of DNN. Previously my local copy of DNN was 9.1.0.367, it is now 9.1.1.129 whereas the production instance is at 9.1.1.113 .

    It's not ideal that fixing it required a total reinstantiation of my development environment, but I believe a simple upgrade to an equal or greater version of the destination site would have fixed the issue as well.