This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".
This solved my error on Windows Server 2012, IIS 8.5. Should work for other versions too.
Go to Server Manager, click add Roles and Features
In the roles section choose: Web Server
Under Security sub-section choose everything (I excluded digest, IP restrictions and URL authorization as we don't use them)
Under Application Development choose .NET Extensibility 4.5 and ASP>NET 4.5, both ISAPI entries
In the Features section choose: NET 3.5, .NET 4.5, ASP.NET 4.5
In the Web server section choose: Web Server (all), Management Tools (IIS Management Console and Management Service), Windows