EllanJiang/GameFramework · error · GameFrameworkException

Name is invalid.

Error message

Name is invalid.

What it means

The Asset class nested in UpdatableVersionList validates the asset name in its constructor because each asset must be identified by name within the update list. A null or empty name is rejected with a GameFrameworkException at construction. This keeps the updatable version list free of unidentifiable entries.

Solutions

  1. Pass a valid non-empty asset name to the Asset constructor
  2. Regenerate the updatable version list with the packaging pipeline
  3. Fix the deserialization logic so the name field is populated

Example fix

// before
new Asset(null, dependencyAssetIndexes);
// after
if (string.IsNullOrEmpty(name)) throw new ArgumentException("Asset name required");
new Asset(name, dependencyAssetIndexes);
Defensive patterns

Strategy: validation

Validate before calling

if (string.IsNullOrEmpty(assetName)) { Log.Error("Asset entry missing name"); return; }

Type guard

bool IsValidAssetEntry(string n) => !string.IsNullOrEmpty(n);

Try / catch

try { var a = new Asset(name, deps); } catch (GameFrameworkException ex) when (ex.Message == "Name is invalid.") { Log.Error(ex, "Invalid asset entry in version list"); }

Prevention

When it happens

Trigger: Constructing UpdatableVersionList.Asset directly, or deserializing an updatable version list whose asset entry has a null or empty name.

Common situations: Corrupted update version file from a bad download, packaging tool output missing the name field, or binary parse reading an empty string due to offset/length mistakes.

Related errors


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

Appendix: source

Thrown at GameFramework/Resource/UpdatableVersionList.Asset.cs:34

        /// </summary>
        [StructLayout(LayoutKind.Auto)]
        public struct Asset
        {
            private static readonly int[] EmptyIntArray = new int[] { };

            private readonly string m_Name;
            private readonly int[] m_DependencyAssetIndexes;

            /// <summary>
            /// 初始化资源的新实例。
            /// </summary>
            /// <param name="name">资源名称。</param>
            /// <param name="dependencyAssetIndexes">资源包含的依赖资源索引集合。</param>
            public Asset(string name, int[] dependencyAssetIndexes)
            {
                if (string.IsNullOrEmpty(name))
                {
                    throw new GameFrameworkException("Name is invalid.");
                }

                m_Name = name;
                m_DependencyAssetIndexes = dependencyAssetIndexes ?? EmptyIntArray;
            }

            /// <summary>
            /// 获取资源名称。
            /// </summary>
            public string Name
            {
                get
                {
                    return m_Name;
                }
            }

            /// <summary>

View on GitHub (pinned to d0c010b051)