system.ni.dll Error in Windows 10 and 11: Native image of the .NET Framework System assembly

A classic .NET Framework application fails at startup and names system.ni.dll in its runtime error. If the message or log names system.ni.dll, capture the full path, Windows build and time of the failure.
Microsoft binary metadata identifies this file as .NET Framework. Use the filename as a diagnostic clue and check the action that failed before repairing Windows.
Isolate the failure
Confirm the faulting path is in a .NET Framework native-image cache and record the application’s required Framework version. Compare a second known-good Framework app.
Repair the affected component
Repair the .NET Framework using the Microsoft tool for the supported version. Update or repair the application separately if the error affects that app alone. Leave native-image generation to the framework or vendor installer.
For a protected Windows file, use Microsoft’s System File Checker instructions when there is evidence of Windows component damage. Keep DLLs supplied by Windows or the full vendor package.
Verify the repair
Open the same app under the same user and repeat its startup action. Check the Application event log around the new test time.
See Microsoft’s guidance for this feature, the exact Windows file record, and the related PC Repair Atlas guide.