windowscodecsraw.dll Error in Windows 10 and 11: Raw photo preview errors

Windows cannot preview RAW photos or a photo app reports a component error naming windowscodecsraw.dll.
What this DLL does
This filename is associated with Windows imaging codec components for certain camera RAW formats. Availability varies by Windows release and installed codec support.
Start with this check
Check your camera model and exact file extension. Compare a known-good photo from the same camera with an ordinary JPEG and keep original photos backed up.
Write down the exact message, the time, and what you were doing. If the application closes, open View reliability history from Start, select the matching failure, and copy its technical details. An exception code, full module path and application version help identify the next test.
Choose the appropriate repair
Use a supported Microsoft or camera-vendor RAW extension or viewer for the model. If only one file fails, obtain a clean copy from the camera storage rather than reinstalling every codec.
Use Microsoft’s application repair options when only one program fails and its publisher supports those options. If multiple built-in Windows features fail and there are signs of Windows system file corruption, follow Microsoft’s DISM and System File Checker instructions in that order. Use trusted Windows or publisher packages when restoring DLLs.
Verify the result
Open and preview a copy of a test RAW photo, then verify the original remains readable in supported software. Keep the original error information until the same operation also works after a restart.
The DLL Errors & Fixes Library includes related troubleshooting, including windowscodecs.dll. Reference: Microsoft’s Windows Imaging Component documentation.