EllanJiang/GameFramework · error · GameFrameworkException

You can not use GenerateReadWriteVersionListLength at this…

Error message

You can not use GenerateReadWriteVersionListLength at this time.

What it means

The ResourceManager.GenerateReadWriteVersionListLength property setter throws this when m_ResourceUpdater is null. The updater (and with it this setting) only exists after the resource system enters update mode (e.g. SetResourceMode with update enabled); before that there is nothing to configure.

Solutions

  1. Set the property only after entering an update mode where the ResourceUpdater exists (after the updater has been created by the resource system's init).
  2. Skip the setting when the game runs in non-updatable resource modes.
  3. Wrap the setter in a null/state check on your side and defer the assignment until the updater is available.

Example fix

// before
m_ResourceManager.GenerateReadWriteVersionListLength = 1024 * 1024; // updater not created yet
// after
if (m_ResourceManager.ResourceMode == ResourceMode.Updatable)
{
    m_ResourceManager.GenerateReadWriteVersionListLength = 1024 * 1024;
}
Defensive patterns

Strategy: validation

Validate before calling

// C#
if (m_ResourceManager.ResourceMode == ResourceMode.Updatable)
{
    m_ResourceManager.GenerateReadWriteVersionListLength = 1024 * 1024;
}

Try / catch

// C#
try
{
    m_ResourceManager.GenerateReadWriteVersionListLength = value;
}
catch (GameFrameworkException ex) when (ex.Message.Contains("GenerateReadWriteVersionListLength"))
{
    // defer setting until update mode is active
}

Prevention

When it happens

Trigger: Setting GenerateReadWriteVersionListLength at startup before the resource updater has been created by the resource system's initialization/mode switch.

Common situations: Config scripts that apply all ResourceManager settings up front, including update-only settings, in non-update resource modes; settings applied before SetResourceMode(ResourceMode.Package/Updatable...).

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15). Data as JSON: /api/errors/8b5667a93ae01c74. Report an issue: GitHub.

Appendix: source

Thrown at GameFramework/Resource/ResourceManager.cs:326

            {
                m_UpdatePrefixUri = value;
            }
        }

        /// <summary>
        /// 获取或设置每更新多少字节的资源,重新生成一次版本资源列表。
        /// </summary>
        public int GenerateReadWriteVersionListLength
        {
            get
            {
                return m_ResourceUpdater != null ? m_ResourceUpdater.GenerateReadWriteVersionListLength : 0;
            }
            set
            {
                if (m_ResourceUpdater == null)
                {
                    throw new GameFrameworkException("You can not use GenerateReadWriteVersionListLength at this time.");
                }

                m_ResourceUpdater.GenerateReadWriteVersionListLength = value;
            }
        }

        /// <summary>
        /// 获取正在应用的资源包路径。
        /// </summary>
        public string ApplyingResourcePackPath
        {
            get
            {
                return m_ResourceUpdater != null ? m_ResourceUpdater.ApplyingResourcePackPath : null;
            }
        }

        /// <summary>

View on GitHub (pinned to d0c010b051)