Is there potentially a version mismatch between the .NET Framework version that your website is targeting as compared to the .NET Framework Runtime version installed on the Web Server?
And are you deploying a website that is not precompiled and/or is updatable? -
.NET Runtime version upgrades are intended to be highly backwards compatible. However, I ran into a very similar issue when migrating multiple websites targeting the .NET 4.5.1 Framework from a Windows Server 2008 R2 server to a Windows Server 2012 R2 server patched up to the .NET 4.6 Runtime. All of my initial page loads (on multiple websites) began taking two minutes for each individual page, instead of a split second. And all of my experiments with different IIS settings were unsuccessful in resolving the issue.
Ultimately I was able to resolve the issue in one of two ways:
- Fully recreating the server, patched up to the .NET 4.5 Runtime did resolve my issue (along with adding a registry setting to block the install of .NET 4.6.1).
- Alternatively, redeploying my websites with "Precompile" checked and with "Allow to be updatable" unchecked also resolved my issue.
By contrast, all of my attempts to roll back or repair the .NET Runtime version on the server to the .NET 4.5 Runtime did not resolve my page load issues. (There is essentially no clean, reliable process to fully rollback a .NET Runtime short of re-imaging the server.)