Description

For non document library it returns null.

Resolution

Check that you work with document library. Use SPWeb.GetFile(SPListItem.UniqueId) instead.


var file = item.Web.GetFile(item.UniqueId);


Links