ERROR_SXS_XML_E_COMMENTSYNTAX (0X000036CF) Fix: Comment Syntax in .manifest Files
XML comment syntax inside a Windows manifest file is broken — wrong dash sequence or malformed structure. Fix it by editing the manifest directly.
Quick answer: Open the .manifest file, find the comment that starts with <!-- (three dashes) or ends with --> (three dashes), and convert it to valid XML: <!-- comment --> exactly two dashes each side. No triple dashes, no funny business.
Here's what's actually happening. Windows side-by-side (SxS) assembly manifests are XML files, and XML comments have a strict grammar: they must start with <!-- and end with -->. The spec says you cannot have the string "--" inside a comment other than the closing delimiter. Microsoft's manifest parser (the one that throws 0x000036CF) catches malformed comments that other XML parsers might let slide. The error code ERROR_SXS_XML_E_COMMENTSYNTAX maps directly to the XML parser's comment syntax violation. I've seen this most often when someone manually edits a manifest file in Notepad and accidentally adds an extra dash — <!--- — or when a build script concatenates comment markers incorrectly.
You'll see this error in the Windows Application Event Log under source "SideBySide" with event ID 33 or 63, paired with that exact hex code. The message reads something like "Manifest parse error: Incorrect syntax was used in a comment." The application won't start because Windows can't load the requested dependent assembly. It's a parse-time failure, not a runtime crash.
Step-by-Step Fix
- Identify the broken manifest
Open Event Viewer (eventvwr.msc), go to Windows Logs > Application. Look for event ID 33 or 63 from source SideBySide. The event details will include the full path to the .manifest file — copy that path. In my experience, this is usually insideC:\Program Files\SomeApp\orC:\Windows\WinSxS\Manifests\for system files. - Back up the manifest
Copy the file somewhere safe. I use a timestamped backup:copy app.manifest app.manifest.bak.2024-12-01. - Find the comment
Open the manifest in a text editor that shows line numbers — Notepad++ works, but Visual Studio Code is better because it highlights XML errors. Search for:
These are the usual suspects. The XML comment must be exactly:<!-- !--> --!> <!--- -->
Two dashes, no spaces inside the delimiters (spaces after are fine). Anything else is invalid.<!-- your comment text --> - Fix the syntax
If you find<!---, remove the extra dash:<!--.
If you find--!>, change it to-->.
If the comment contains--in the middle (e.g.,<!-- do -- not do this -->), rewrite it without consecutive dashes. Example:<!-- do - not do this -->. - Validate the XML
Run this command from an elevated Command Prompt to re-parse the manifest:
That checks system integrity, but it also triggers manifest validation. Alternatively, you can use thesfc /VERIFYONLYmt.exetool from the Windows SDK:
If mt.exe says "manifest validation succeeded" (exit code 0), you're good.mt.exe -manifest app.manifest -validate_manifest - Clear the cached manifest (if still broken)
Windows caches manifest data in memory. Restart the application — or restart the machine if you're not sure. I've had cases where the error persisted until a full reboot because the SxS cache hadn't been flushed.
Alternative Fixes If That Doesn't Work
Option A: Remove the comment entirely
If the comment isn't critical (and most aren't), just delete the whole <!-- ... --> block. Save the file, revalidate. This is the nuclear option but works every time. I do this when I can't figure out which comment is malformed — just nuke them all.
Option B: Re-extract the manifest from the binary
If the manifest is embedded inside a .dll or .exe (common with side-by-side assemblies), you can't edit the file directly. Use Resource Hacker or mt.exe -extract to pull it out, fix it, then re-embed. The command:
mt.exe -inputresource:app.exe;#1 -out:app.manifest
Fix the manifest as above, then:mt.exe -manifest app.manifest -outputresource:app.exe;#1
This requires admin rights and the Windows SDK. Backup the original .exe first.
Option C: Reinstall the application
If the manifest came from an installer (like a Visual C++ redistributable), run the installer again with repair option. For system manifests, run DISM /Online /Cleanup-Image /RestoreHealth followed by sfc /scannow. This replaces corrupted manifests from the component store.
Prevention Tip
Never edit .manifest files with Notepad. Use an XML-aware editor that validates syntax in real time. If you're writing build scripts that generate manifests, output the XML using a proper XML library (like XmlWriter in .NET) — don't build strings with string concatenation. A single trailing dash from a variable will break the comment syntax and kill your deployment. Trust me, I've debugged this at 2 AM during a release. The fix takes 5 minutes, the diagnosis can take an hour.
Was this solution helpful?