Hi Wuttipong,
Thanks for reaching out Microsoft Community Forum. I totally understand your having trouble with your system set up. Let me help you install it properly.
The cause of error means DISM can’t find the files it needs to install IIS. Even if you use sources\sxs, the ISO may not match your installed OS version exactly. to fix this:
☻ This error happens when Windows can’t find the right files to install IIS or the ISO you are using was not exactly match with your Windows version.
** Step1: Check your current system version
- Press Windows + R
- Then type winver
- And press Enter
- Note the Version, Build, and Language
** Step2: Use an ISO that exactly matches that version and build
- Usually Windows 10 version 1809 (build 17763), for LTSC 2019
- If your installed OS is updated with patches, try to get the ISO with the latest cumulative updates
** Step3 Mount the correct ISO and run code below:
DISM /Online /Enable-Feature /FeatureName:IIS-WebServerRole /All /LimitAccess /Source:D:\sources\sxs
- Replace the D: with the correct drive letter for the mounted ISO.
☻ Try Additional IIS Features Only if Needed
- To avoid install conflicts, don’t add too many optional features unless required.
☻ Optional: If it is still not working Check Logs
- Check the log file:
C:\Windows\Logs\DISM\dism.log
- This shows more details about what are missing.
☻ Tools That Help
To check available features use the command:
DISM /Online /Get-Features | find "IIS"
I hope this helps and works for you.
Best Regards,
Kelvin || Independent Adviser