Iis – Website in IIS not serving static files

iis

I have an ASP.NET MVC website in IIS 8.5 running on Windows Server 2012 R2 which refuses to load static content. .NET 4.5 extensibility and ASP.NET 4.5 are installed on the server, as well as the static files module. The static file handler is set up and correctly configured on the website. Still, I just get a 500 – Internal Server Error when trying to access any static files (.js, .css). I've verified that the files exist physically. The .cshtml files of the application are rendered correctly and the HTML output is correct, but none of the resources referenced by it will load. This is also true when trying to directly access them via URL.

The advice I've found stops at the static file handler. What can I troubleshoot next?

Best Answer

The IIS failed request trace logs showed that there was an error with impersonation when reading the static files. The group IIS_IUSRS did not have the Impersonate a client after authentication user right in the computer's Local Security Policy. After adding this, the files now load as expected.

Can anyone explain why, though? Why would this user right be required?