In ASP.NET web.config, when you want to use a configuration which is locked at a parent level in a machine/server, you need to explicitly unlock it to use web.config for your site.
Typical error would be like, “This configuration section cannot be used at this path. This happens when the section is locked at a parent level.”, followed by information about the config section in question.
To unlock the section run the below command in Command Prompt (administrator mode):
%windir%\system32\inetsrv\appcmd.exe unlock config -section:<section/path/here>
Use below command to view all the sections available:
%windir%\system32\inetsrv\appcmd.exe unlock config -section:?
Once unlocked, restart the Web Site or IIS.
Learn more about configuration section locking in IIS here.