Thank you for contacting Sitefinity Support.
It seems that the problem is coming from the fact the library is created without item_default_url. This is causing troubles when you want to filter the documents by the corresponding library.
In order to fix the issue, just include the following line:
in the code below:
LibrariesManager libraryManager = LibrariesManager.GetManager();
var library = libraryManager.GetDocumentLibraries().Where(l => l.Title ==
library = libraryManager.CreateDocumentLibrary(Guid.NewGuid());
library.DateCreated = DateTime.UtcNow;
library.LastModified = DateTime.UtcNow;
library.PublicationDate = DateTime.UtcNow;
library.Status = ContentLifecycleStatus.Master;
If you have any additional questions, do not hesitate to contact us.
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