This question came from @AlphonseAmala on Twitter:

@Sitecore need replacement function for StringUtil.GetSizeString(long size) - it's not available in Sitecore.Kernel version 14 (Sitecore 9.3 migration) issue. Need help

When upgrading to Sitecore Experience Platform 9.3, what change should be made to replace GetSizeString(long size)?

1 Answer 1


In the Sitecore Experience Platform 9.2 release, the Sitecore.StringUtil.GetSizeString(long) method was marked as [Obsolete]. It was removed in version 9.3.

When building against 9.2, the Obsolete error message displayed reads:

Please use 'MainUtil.FormatSize(size, translate: false)' API instead.

This utility method is also found in the same namespace and DLL (Sitecore.Kernel).

When upgrading to Sitecore XP 9.3, replace your calls to StringUtil.GetSizeString(long size) with MainUtil.FormatSize(long size,bool translate).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.