dotnet/runtime · error · RuntimeError
No .mc files generated.
Error message
No .mc files generated.
What it means
Raised by SuperPMICollect.__collect_mc_files__ in superpmi.py at the end of collection. It lists '*.mc' files in temp_location; if zero were produced, the collection produced no method contexts and the merge step would have nothing to work on, so it aborts.
Solutions
- Re-run collection with -log_level debug and inspect why no .mc files appear (check the shim path and per-assembly exit codes).
- Verify Core_Root contains the SuperPMI collector shim (superpmi-shim-collector.*) and the shim JIT, and that -core_root is correct.
- Confirm -assemblies/-ilc_rsps actually resolve to compilable inputs and none are entirely excluded by -exclude.
- For R2R images, add --disable_r2r so methods get JIT-compiled and collected.
Example fix
// before python superpmi.py collect --pmi -assemblies bin/ # 'No .mc files generated.' // after python superpmi.py collect --pmi -assemblies bin/ --disable_r2r -log_level debug --core_root <valid Core_Root>
Defensive patterns
Strategy: validation
Validate before calling
import os, glob
mc_files = glob.glob(os.path.join(temp_location, "*.mc"))
if not mc_files:
raise SystemExit("Collection produced no .mc files; verify the SuperPMI shim/JIT path and inputs") Prevention
- Always run collection with -log_level debug until it succeeds at least once.
- Verify Core_Root has the collector shim and shim JIT, and that inputs are real compilable assemblies.
When it happens
Trigger: The collection command / PMI / crossgen2 / nativeaot run completed but the SuperPMI shim wrote no .mc files into the temp directory — e.g. the shim was not loaded (SuperPMIShimPath wrong), the target assemblies had no methods, or every collection invocation failed.
Common situations: Wrong SuperPMIShimPath or shim JIT missing from Core_Root; collection_command failed silently; -assemblies pointed at an empty/excluded directory; DOTNET_TieredCompilation/ReadyToRun settings prevented JIT compilation; disk/permission issue in temp_location.
Related errors
- Expected a '.ilc.rsp' file for nativeaot, but got
- Final mch file failed to be generated.
- MCH file failed to be generated at
- Pass only one tiering option.
- Tiering options have no effect for nativeaot collections.
AI-assisted analysis of dotnet/runtime@60108ba66e (2026-08-10).
Data as JSON: /api/errors/0c880c2771598baf.
Report an issue: GitHub.
Appendix: source
Thrown at src/coreclr/scripts/superpmi.py:1350
# Set environment variables.
nativeaot_command_env = env_copy.copy()
set_and_report_env(nativeaot_command_env, root_env)
old_env = os.environ.copy()
os.environ.update(nativeaot_command_env)
ilc_rsps = list(filter(lambda ilc_rsp: ilc_rsp.endswith(".ilc.rsp"), ilc_rsps))
helper = AsyncSubprocessHelper(ilc_rsps, verbose=True)
helper.run_to_completion(run_nativeaot, self)
os.environ.clear()
os.environ.update(old_env)
################################################################################################ end of "self.coreclr_args.nativeaot is True"
mc_files = [os.path.join(self.temp_location, item) for item in os.listdir(self.temp_location) if item.endswith(".mc")]
if len(mc_files) == 0:
raise RuntimeError("No .mc files generated.")
def __merge_mc_files__(self):
""" Merge the mc files that were generated
Notes:
mcs -merge <s_baseMchFile> <s_tempDir>\\*.mc -recursive -dedup -thin
"""
logging.info("Merging MC files")
pattern = os.path.join(self.temp_location, "*.mc")
command = [self.mcs_path, "-merge", self.base_mch_file, pattern, "-recursive", "-dedup", "-thin"]
run_and_log(command)
if not os.path.isfile(self.base_mch_file):
raise RuntimeError("MCH file failed to be generated at: %s" % self.base_mch_file)View on GitHub (pinned to 60108ba66e)