ModulePageFacade.PlaceUnder throws a NullReferenceException
I'm trying to install a module using the fluent API and I'm running into the following error.
----------------------------------------Timestamp: 12/20/2011 4:47:34 PMMessage: HandlingInstanceID: 52582b92-9d03-486f-b453-b4158453dfbeAn exception of type 'System.NullReferenceException' occurred and was caught.-----------------------------------------------------------------------------12/20/2011 11:47:33Type : System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089Message : Object reference not set to an instance of an object.Source : Telerik.SitefinityHelp link : Data : System.Collections.ListDictionaryInternalTargetSite : Void ChangeParent(Telerik.Sitefinity.Pages.Model.PageNode, Telerik.Sitefinity.Pages.Model.PageNode, Boolean)Stack Trace : at Telerik.Sitefinity.Modules.Pages.PageManager.ChangeParent(PageNode childNode, PageNode newParent, Boolean storeCurrentUrlAsAdditional) at Telerik.Sitefinity.Fluent.Modules.ModulePageFacade`1.PlaceUnder(CommonNode commonNode) at CaseStudies.CaseStudiesModule.InstallPages(SiteInitializer initializer) in C:\_Projects\EL.com\CaseStudies\CaseStudiesModule.cs:line 70 at Telerik.Sitefinity.Modules.GenericContent.ContentModuleBase.Install(SiteInitializer initializer) at CaseStudies.CaseStudiesModule.Install(SiteInitializer initializer) in C:\_Projects\EL.com\CaseStudies\CaseStudiesModule.cs:line 49 at Telerik.Sitefinity.Services.ModuleBase.Install(SiteInitializer initializer, Version upgradeFrom) at Telerik.Sitefinity.Services.SystemManager.InitializeModule(ModuleSettings settings, InstallContext installContext, Boolean start)Additional Info:MachineName : EL-00020-PCTimeStamp : 12/20/2011 4:47:33 PMFullName : Telerik.Sitefinity.Utilities, Version=4.2.1650.0, Culture=neutral, PublicKeyToken=b28c218413bdf563AppDomainName : /LM/W3SVC/8/ROOT-3-129688732458111214ThreadIdentity : WindowsIdentity : NT AUTHORITY\NETWORK SERVICERequested URL : http://127.0.0.1/Category: ErrorLogPriority: 0EventId: 9010Severity: WarningTitle:Enterprise Library Exception HandlingMachine: EL-00020-PCApp Domain: /LM/W3SVC/8/ROOT-3-129688732458111214ProcessId: 11040Process Name: c:\windows\system32\inetsrv\w3wp.exeThread Name: Win32 ThreadId:11888Extended Properties: ----------------------------------------protected override void InstallPages(SiteInitializer initializer) var pageManager = initializer.PageManager; App.WorkWith().Module(ModuleName, pageManager) .Install() .CreateModulePage(LandingPageId, "Case Studies") .PlaceUnder(CommonNode.TypesOfContent) .SetOrdinal(1) .ShowInNavigation() .SetTitle("Case Studies") .SetUrlName("case-studies") .AddControl(new Literal Text = "<h1>Hello, Case Studies!</h1>" ) .Done(); Hi,
Thank you for the information. However, I could not reproduce this exception embedding your code in one of our sample custom modules.
It would be great help if you could share an archive of your project folder, including the custom module and a backup of your database (or at least all the custom files related to your module), so we can reproduce the error in a debugged environment and get to the cause of this issue.
Thank you.
Wishing you happy holidays and a happy new year!