QL-Win/QuickLook · error · InvalidDataException
AppxMetadata/AppxBundleManifest.xml not found
Error message
AppxMetadata/AppxBundleManifest.xml not found
What it means
Thrown by AppxBundleReader.Open when the zip archive does not contain an entry named 'AppxMetadata/AppxBundleManifest.xml'. This entry is mandatory in every valid .appxbundle; its absence means the file is not an app bundle, is corrupt, or has an unexpected structure. The error is an InvalidDataException.
Source
Thrown at QuickLook.Plugin/QuickLook.Plugin.AppViewer/PackageParsers/Appx/AppxBundleReader.cs:71
public AppxBundleReader(string path)
{
Open(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read));
}
public void Dispose()
{
appxReader?.Dispose();
appxReader = null;
zip?.Close();
zip = null;
}
private void Open(Stream stream)
{
zip = new ZipFile(stream);
ZipEntry entry = zip.GetEntry("AppxMetadata/AppxBundleManifest.xml")
?? throw new InvalidDataException("AppxMetadata/AppxBundleManifest.xml not found");
XmlDocument xml = new() { XmlResolver = null };
xml.Load(zip.GetInputStream(entry));
XmlElement bundleNode = xml.DocumentElement;
// Identity
{
XmlElement identityNode = bundleNode["Identity"];
if (identityNode != null)
{
name = identityNode.Attributes["Name"]?.Value;
version = identityNode.Attributes["Version"]?.Value;
publisher = identityNode.Attributes["Publisher"]?.Value;
Match m = Regex.Match(Publisher, @"CN=([^,]*),?");
if (m.Success) publisher = m.Groups[1].Value;View on GitHub (pinned to cb5d9c429c)
Solutions
- Confirm the file is actually an .appxbundle (look for AppxMetadata/AppxBundleManifest.xml inside the zip) before constructing AppxBundleReader.
- If the file is a single .appx/.msix package, use AppxReader instead.
- List zip entries and check for the manifest path; if missing, surface a clear 'not an app bundle' message.
- Handle InvalidDataException and fall back to trying AppxReader.
Example fix
// before
var reader = new AppxBundleReader(path);
// after
using var zip = new ICSharpCode.SharpZipLib.Zip.ZipFile(path);
bool isBundle = zip.GetEntry("AppxMetadata/AppxBundleManifest.xml") != null;
zip.Close();
if (!isBundle)
throw new InvalidDataException($"{path} is not an .appxbundle (manifest missing).");
var reader = new AppxBundleReader(path); Defensive patterns
Strategy: validation
Validate before calling
// Confirm the zip contains the bundle manifest before constructing AppxBundleReader.
public static bool IsAppxBundle(string path)
{
try
{
using var zip = new ICSharpCode.SharpZipLib.Zip.ZipFile(path);
return zip.GetEntry("AppxMetadata/AppxBundleManifest.xml") != null;
}
catch { return false; }
} Try / catch
try { var reader = new AppxBundleReader(path); }
catch (InvalidDataException ex) when (ex.Message.Contains("AppxBundleManifest"))
{
// Not an .appxbundle; try AppxReader for a single .appx package instead.
} Prevention
- Distinguish .appx (single package) from .appxbundle before choosing the reader.
- Verify the manifest entry exists in the zip before constructing the reader.
- Catch InvalidDataException and fall back to AppxReader.
When it happens
Trigger: Constructing new AppxBundleReader(stream) or new AppxBundleReader(path) on a file that is a plain .appx (not a bundle), a .msix, a zip with unrelated contents, or a corrupt/truncated .appxbundle whose manifest entry is missing or at a different path.
Common situations: Passing an .appx (single package) to AppxBundleReader instead of AppxReader; passing an .msix bundle whose manifest path differs; a partially downloaded/corrupt bundle; a repackaged zip that lost the AppxMetadata directory.
Related errors
- AppxManifest.xml not found
- Not a valid ar file
- The specified file does not appear to be an OLE Compound Fil
- DS_Store header too short
- DS_Store: wrong magic (expected 0x00000001)
AI-assisted analysis of QL-Win/QuickLook@cb5d9c429c (2026-08-13).
Data as JSON: /api/errors/6bcfe0fe3a7c82a6.
Report an issue: GitHub.