We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

NullReferenceException Occurs when Calling FolderInfo.RetrieveFullPath Method

I am getting an error when calling RetrieveFullPath on a FolderInfo when using the pst.Load (it does not throw an error on the pst.FromStream method)

Error:
‘folder.RetrieveFullPath()’ threw an exception of type ‘System.NullReferenceException’
Data: {System.Collections.ListDictionaryInternal}
HResult: -2147467261
HelpLink: null
InnerException: null
Message: “Object reference not set to an instance of an object.”
Source: “Aspose.Email”
StackTrace: " at #=zW3AYOuBNWDAnm7tlRbK6bLGsLtiSvweiE3$Np7o=.#=zD84fCswADwNt(#=zWceaMp7zHawx2UuSGv6Fpj6XJYlvWh_URw== #=zZdkyoPQ=, String #=zWb2uhDs=)\r\n at Aspose.Email.Storage.Pst.FolderInfo.RetrieveFullPath()"
TargetSite: {System.String #=zD84fCswADwNt(#=zWceaMp7zHawx2UuSGv6Fpj6XJYlvWh_URw==, System.String)}

The folder object itself is fine and has the following values:
{Aspose.Email.Storage.Pst.FolderInfo}
ContainerClass: “”
ContentCount: 0
ContentUnreadCount: 0
DisplayName: “Top of Personal Folders”
EntryId: {byte[24]}
EntryIdString: “AAAAALKXWhXMhcdNozGiT39VJ0oigAAA”
HasSubFolders: true
LastModificationTime: {1/1/0001 12:00:00 AM}
Properties: {Aspose.Email.Mapi.MapiPropertyCollection}

Thanks

@brttnybrns,

If I correctly understand the issue you have described, the following code must generate NullReferenceException.

namespace AsposeEmailTests
{
    class Program
    {
        static void Main(string[] args)
        {
            var pst = Aspose.Email.Storage.Pst.PersonalStorage.FromFile("my.pst");
            var path = pst.RootFolder.RetrieveFullPath();
        }
    }
}

I can’t reproduce the issue. What Aspose Email library version do you use? Could you please provide the complete code example that leads to the issue. Thanks.