Share via

ApplicationDataCompositeValue Size

Madhu 96 Reputation points
2021-01-03T10:32:05.23+00:00

Hi,

The documentation here says ' each composite setting can be up to 64K bytes in size' https://learn.microsoft.com/en-us/uwp/api/windows.storage.applicationdata.localsettings?view=winrt-19041

But I don't see a difference in the size allowed for below composite data. Still it gives the size exceed error when the size of 'courses' pass 8kb.
So there is no difference in size allowed in localSettings.Values["partially_downloaded_courses"] = courses vs below

            Windows.Storage.ApplicationDataCompositeValue partialDownloadComposite = new Windows.Storage.ApplicationDataCompositeValue();  
            partialDownloadComposite["test"] = 1;  
            partialDownloadComposite["partialCoursesData"] = courses;  
            localSettings.Values["partially_downloaded_courses"] = partialDownloadComposite;  

According to the answer given here I thought the composite setting should allow 64kb so the courses can be upto 64kb.
https://social.msdn.microsoft.com/Forums/en-US/ee876958-3eed-4619-b536-f9790247a8da/what-is-the-maximum-size-allowed-in-local-settings-value?forum=wpdevelop

Can you please explain what is meant by ' each composite setting can be up to 64K bytes in size' and how do I store a composite setting of 64kb in local storage.

Thanks
Madhu

Developer technologies | Universal Windows Platform (UWP)
0 comments No comments

Answer accepted by question author

Anonymous
2021-01-04T07:23:25.703+00:00

Hello,

Welcome to Microsoft Q&A!

You might misunderstand the mean of The composite setting is composed of many settings, the size of each setting can be up to 8K bytes, and the total size of these settings can be up to 64K bytes in size. . 64K bytes limitation is the total size limitation of the ApplicationDataCompositeValue. The single setting inside the ApplicationDataCompositeValue is up to 8K bytes.

In your scenario, the size of partialDownloadComposite["partialCoursesData"] is limited to 8kb, and the total size of partialDownloadComposite["partialCoursesData"] and partialDownloadComposite["test"] is limited 64kb.

Thank you.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.