OK, this was driving me insane …

About 4 weeks ago I noticed on my development SharePoint farm, that whatever list I went to, whenever I tried to view the List Settings I would get the error below:

NullReferenceException: Object reference not set to an instance of an object.]    Microsoft.SharePoint.ApplicationPages.ListEditPage.SetSectionLinks() +426    Microsoft.SharePoint.ApplicationPages.ListEditPage.OnLoad(EventArgs e) +896    ASP._layouts_listedit_aspx.OnLoad(EventArgs e) +290    System.Web.UI.Control.LoadRecursive() +65    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2427

I thought at first it must have been me , as I was playing around with Custom Actions at the time. I couldn’t see anything obvious so I ended up re-installing my development SharePoint farm. I then had to go off and do other work, when I got back I found that the same thing was happening!  I decided to start ploughing my way through DLLs using Reflector and tracked down the issue to something around a control on the ListEdit.aspx page, but again I got dragged away.  Back to my development farm today, the issue was still present, I wondered if anybody had solved this issue and full credit to this partner on this forum post they yesterday identified the culprit and it’s really probably only a Development box issue, at least it should be …

Basically the error was due to an older version of Microsoft.SharePoint.ApplicationPages.dll existing in the GAC.  That DLL is not by default in the GAC, but it has gotten in there due to a TFS/Project Structure requirement.  Of course, along comes SP1 which updates Microsoft.SharePoint.ApplicationPages.dll  in the _app_bin folder of each Web Application which is where it normally sits, and also updates ListEdit.aspx  in the Layouts folder.  Lo and behold a control is removed from the ListEdit.aspx page but somehow the GAC version is still loaded which causes the error.

To resolve the error do one of two things:

  • Remove the Microsoft.SharePoint.ApplicationPages.dll from the GAC, or …
  • If your TFS/Project Development Pattern means you need/would like a copy in the GAC, then you must update your copy in the GAC to the same version as exists in the _app_bin folder using GACUTIL.

It worked a treat for me.

I’m puzzled though … I thought that the _app_bin version always took precedent over the GAC version? Or is that just the bin version?  Any thoughts anybody?

Cheers

Dave Mc

2 responses

  1. […] SetSectionLinks() and “Object reference not set to an instance of an object” […]

  2. Thanks! You’re a life saver. As far as GAC’d DLLs vs. _app_bin goes, I though the GAC always wins. I don’t know for sure.

Leave a comment

The Blog

Dave Mc muses about history, travel, writing, coaching, astronomy, technology and life, family and the world around us. You may agree with his opinions, you may not, that’s life …