I am attempting to call SPListCollection.EnsureSitePagesLibrary()
upon FeatureActivated. The method is throwing the following exception:
Microsoft.SharePoint.SPException: A list, survey, discussion board, or document library with the specified title already exists in this Web site. Please choose another title.
If I check for the list: if (lists.TryGetList("Site Pages") == null)
before the call to EnsureSitePagesLibrary()
, the method is still executed and the exception is still thrown. Furthermore, when browsing the site through SharePoint Manager 2010, there is no sign of the Site Pages library. Can someone help explain this behavior?
Thanks!