Problem installaing .NET Framework 3.5 on Windows 8

When I tried to install .NET Framework 3.5 (includes .NET 2.0 and 3.0) from “control panel/programs and features/turn windows features on or off” I got the following error code 0x800F081F.
The solution was to install .Net 3.5 via DIM:
dism.exe /online /enable-feature /featurename:NetFX3 /Source:d:\sources\sxs /LimitAccess

D: = DVD drive/USB drive or ISO.