EllanJiang/GameFramework · error · GameFrameworkException
Can not load binary ' ' from file system which is not use…
Error message
Can not load binary '{0}' from file system which is not use file system. What it means
The resource is a binary asset but ResourceInfo.UseFileSystem is false — this binary was packaged as a loose file on disk, not packed into an (encrypted/packed) file system. LoadBinaryFromFileSystem only reads resources stored inside a file system, so it throws.
Solutions
- Enable file-system packing for the binary in the resource build settings and rebuild the package.
- Or load it via the regular LoadBinary (which handles non-file-system binaries via ResourceHelper.LoadBytes) instead of LoadBinaryFromFileSystem.
- Check UseFileSystem beforehand if you can access resource metadata, and choose the loading path accordingly.
- Wrap in try-catch for GameFrameworkException and fall back to LoadBinary.
Example fix
// before byte[] bytes = m_ResourceComponent.LoadBinaryFromFileSystem(binaryName); // binary stored as loose file // after m_ResourceComponent.LoadBinary(binaryName, new LoadBinaryCallbacks(OnLoadBinarySuccess, OnLoadBinaryFailure), userData);
Defensive patterns
Strategy: fallback
Validate before calling
// read via LoadBinaryFromFileSystem only when the binary is packed in a file system
if (PackingConfig.UseFileSystemFor(binaryName) == false)
{
m_ResourceComponent.LoadBinary(binaryName, callbacks, userData);
return;
} Type guard
bool IsPackedInFileSystem(string name) => PackingConfig.UseFileSystemFor(name);
Try / catch
try { bytes = m_ResourceComponent.LoadBinaryFromFileSystem(binaryName); }
catch (GameFrameworkException ex) when (ex.Message.Contains("not use file system"))
{ m_ResourceComponent.LoadBinary(binaryName, callbacks, userData); } Prevention
- Keep packaging mode (file system vs loose files) and loading code in sync.
- Document which binaries are packed into file systems per build profile.
- Centralize binary loading in one helper that supports both paths.
- Test reads against both packaging configurations in CI.
When it happens
Trigger: Calling LoadBinaryFromFileSystem on a binary whose packaging option put it outside any file system (default 'not use file system' packaging), e.g. binaries stored as separate files in read-only/read-write path.
Common situations: The resource package was built without file-system packing for that binary, but the code assumes the packed path; switching packaging settings between builds without updating load code.
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
- Can not load binary ' ' from file system which is not a…
- Can not load binary ' ' from file system which is not exist.
- Can not load binary ' ' from file system which is not ready.
- Can not load binary ' ' which is not a binary asset.
- Can not load binary ' ' which is not exist.
AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15).
Data as JSON: /api/errors/320c5d1126ec382a.
Report an issue: GitHub.
Appendix: source
Thrown at GameFramework/Resource/ResourceManager.ResourceLoader.cs:638
ResourceInfo resourceInfo = GetResourceInfo(binaryAssetName);
if (resourceInfo == null)
{
throw new GameFrameworkException(Utility.Text.Format("Can not load binary '{0}' from file system which is not exist.", binaryAssetName));
}
if (!resourceInfo.Ready)
{
throw new GameFrameworkException(Utility.Text.Format("Can not load binary '{0}' from file system which is not ready.", binaryAssetName));
}
if (!resourceInfo.IsLoadFromBinary)
{
throw new GameFrameworkException(Utility.Text.Format("Can not load binary '{0}' from file system which is not a binary asset.", binaryAssetName));
}
if (!resourceInfo.UseFileSystem)
{
throw new GameFrameworkException(Utility.Text.Format("Can not load binary '{0}' from file system which is not use file system.", binaryAssetName));
}
IFileSystem fileSystem = m_ResourceManager.GetFileSystem(resourceInfo.FileSystemName, resourceInfo.StorageInReadOnly);
byte[] bytes = fileSystem.ReadFile(resourceInfo.ResourceName.FullName);
if (bytes == null)
{
return null;
}
if (resourceInfo.LoadType == LoadType.LoadFromBinaryAndQuickDecrypt || resourceInfo.LoadType == LoadType.LoadFromBinaryAndDecrypt)
{
DecryptResourceCallback decryptResourceCallback = m_ResourceManager.m_DecryptResourceCallback ?? DefaultDecryptResourceCallback;
decryptResourceCallback(bytes, 0, bytes.Length, resourceInfo.ResourceName.Name, resourceInfo.ResourceName.Variant, resourceInfo.ResourceName.Extension, resourceInfo.StorageInReadOnly, resourceInfo.FileSystemName, (byte)resourceInfo.LoadType, resourceInfo.Length, resourceInfo.HashCode);
}
return bytes;
}
View on GitHub (pinned to d0c010b051)