You’ve probably come here because you were trying to install Microsoft .NET Framework 3.5 on Windows 8.1 and it kept on failing with this silly error, right?
There are some resources on this one online from uninstalling certain updates that aren’t actual anymore to other hacks, but the one that worked for me and is worth giving it a try is just temporarily pausing the antivirus, installing the .NET Framework and resuming it again. In my case it was avast! Antivirus Free, but considering the number of these errors found online, it probably isn’t limited to avast! only.
Because you are disabling antivirus, make sure you only use .NET Framework installer from a trusted source that is digitally signed by Microsoft Corporation. Like the one on link below (goes to official Microsoft webpage).