ngen.exe

by Microsoft
Runtime

Summary

Native Image Generator (ngen.exe) is part of the .NET Framework. It pre-compiles .NET assemblies into native machine code images and installs them into the native image cache, improving application startup performance. It runs as part of .NET optimization tasks.

ngen.exe is the 11th most commonly executed Windows program in EchoTrail's dataset, observed 6,845,569 times across enterprise environments. It typically runs from C:\Windows\Microsoft.NET\Framework\v4.0.30319 and it is most often launched by ngentask.exe.

11th
most commonly executed Windows program
6,845,569
observed executions
high
statistical confidence

Behavior

Top Paths

  • C:\Windows\Microsoft.NET\Framework\v4.0.3031950.59%
  • C:\Windows\Microsoft.NET\Framework64\v4.0.3031949.39%
  • C:\Windows\Microsoft.NET\Framework\v2.0.507270.01%
  • C:\Windows\Microsoft.NET\Framework64\v2.0.507270.01%
  • C:\Windows\Microsoft.NET\Framework\v1.1.4322<0.01%

Top Hashes (SHA256)

  • bd0a1d5ae494628aea2ee55d427869b009be5994d767b1e336a548f4edf64fc119.9%
  • 349cbf8104c3856d750bbb2a241518c3faade9816a500e70b76a40a961e5d6af17.81%
  • 0eb067650f90e1af3b660c229a58d5e4c505a928847349e06dadb5e88df713f410.14%
  • 723f1f680b822bb287f280e9359aed4b28a92a99d874d642c717cea6eebd8eb28.82%
  • e7fab0f72e023f20f332ed97dc0896e725d817eab40e758508308eaa5960d6f86.58%
  • 96e0493ec4ca127c94af1ad7e31e2be618b8c9dcc9e81dcec268a5ceb01db6395.56%
  • a446d35f5e60bdae1a7117b71d90abb0fea424ee416b0e0ecd2c485dc5939a684.33%
  • faceb6f5d1cdc5ad50a4a1b92c4cd3fcdabcf7e8d418014a1b1221c1defa3d8f3.58%
  • 458c9a4f63e67d3e8d5b8cb5372681d4a280fad7441c356abd17517ba50f45e63.16%
  • d0105566bc22ef92204e163428e5feda866f8a9b2be19be3b95e6327fff3f8c63%

Process Ancestry

Top Grandparents

Top Parents

Top Children

Rare or environment-specific process names are omitted from ancestry tables. Percentages are of all observed relationships.

Security Analysis

What does ngen.exe normally do?

Located in C:\Windows\Microsoft.NET\Framework\v4.0.30319 (32-bit) or C:\Windows\Microsoft.NET\Framework64\v4.0.30319 (64-bit). Primarily launched by ngentask.exe (scheduled .NET optimization) or msiexec.exe (during software installation). Spawns mscorsvw.exe (.NET optimization worker). Runs periodically in the background.

When is ngen.exe suspicious?

Running from a non-standard path. Launched by unusual parents (shells, script interpreters). Spawning unexpected child processes beyond mscorsvw.exe.

How do attackers abuse ngen.exe?

Not commonly abused directly. In theory, could be used to compile malicious .NET assemblies into native images, but this is not a well-documented attack technique.

Detection guidance

Low priority. Validate path is within the .NET Framework directories. Unusual parent processes would be the primary indicator of concern.

False positive notes

High execution count is normal — .NET optimization runs frequently, especially after Windows updates or application installations. Bursts of ngen.exe and mscorsvw.exe activity after updates are expected.

Related Processes

Ask Rocky about ngen.exe

Rocky answers questions about ngen.exe grounded in this same dataset — free, no account needed.

Need this data programmatically? The Rocky API includes 500 free lookups a month. Or just ask Rocky.

Data from EchoTrail's dataset of ~346M Windows process executions. Last extracted 2026-08-04.