I have this code running on 8 servers. Now I'm standing up the next 4.
I've reproduced this issue on all 4 servers.
At first, I get:
System.InvalidOperationException: The view 'Index' or its master was not found or no view engine supports the searched locations.
and it lists the correct location of index.cshtml
Then I recycle the website in IIS. From then on, all I get is:
Could not load file or assembly 'Microsoft.CSharp, Version=188.8.131.52, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0x80070542)
I've reproduced this sequence on all 4 new servers.
The 4th, I didn't recycled from IIS, but edited web.config with the same failure results.
I've been through every IIS setting and they all look identical.
All the wwwroot folder permissions seem the same on the servers that work and those that don't.
I'm using a custom app pool that looks identical on both sets.
Procmon says that it is trying to access the C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_184.108.40.206__b03f5f7f11d50a3a\CSharp.dll as
NT AUTHORITY\IUSR and getting
I'm hesitant to install
procmon on a production server, so I can't compare the results there. But I can see that
NT AUTHORITY\IUSR does NOT have effective access to that file on the servers that are working.