1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / ModulePageFacade.PlaceUnder throws a NullReferenceException

ModulePageFacade.PlaceUnder throws a NullReferenceException

2 posts, 0 answered
  1. Jack Murphy
    Jack Murphy avatar
    8 posts
    Registered:
    25 Aug 2009
    20 Dec 2011
    Link to this post
    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 PM
     
    Message: HandlingInstanceID: 52582b92-9d03-486f-b453-b4158453dfbe
    An exception of type 'System.NullReferenceException' occurred and was caught.
    -----------------------------------------------------------------------------
    12/20/2011 11:47:33
    Type : System.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
    Message : Object reference not set to an instance of an object.
    Source : Telerik.Sitefinity
    Help link :
    Data : System.Collections.ListDictionaryInternal
    TargetSite : 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-PC
    TimeStamp : 12/20/2011 4:47:33 PM
    FullName : Telerik.Sitefinity.Utilities, Version=4.2.1650.0, Culture=neutral, PublicKeyToken=b28c218413bdf563
    AppDomainName : /LM/W3SVC/8/ROOT-3-129688732458111214
    ThreadIdentity :
    WindowsIdentity : NT AUTHORITY\NETWORK SERVICE
    Requested URL : http://127.0.0.1/
     
     
    Category: ErrorLog
     
    Priority: 0
     
    EventId: 9010
     
    Severity: Warning
     
    Title:Enterprise Library Exception Handling
     
    Machine: EL-00020-PC
     
    App Domain: /LM/W3SVC/8/ROOT-3-129688732458111214
     
    ProcessId: 11040
     
    Process Name: c:\windows\system32\inetsrv\w3wp.exe
     
    Thread Name:
     
    Win32 ThreadId:11888
     
    Extended Properties:
    ----------------------------------------

    Here's the matching code:

    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();
            }

    Thoughts?
  2. Alon Rotem
    Alon Rotem avatar
    26 posts
    Registered:
    29 Feb 2016
    23 Dec 2011
    Link to this post
    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!

    Greetings,
    Alon Rotem
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered