This afternoon I attempted to start a site on one of my servers that would be used to run .NET 4.0x framework on it. Now I checked and made sure that the Framework was installed. I also checked to make sure my application pool was set to use the framework. However I did notice that the ASP isapi that processes the commands in the Handlers section was still only running the framework 2.0 version. So I switched them over to use the 4.0 and lo and behold it still did not work. Fear not, below is the fix if you are still running into this.

Run this in the command line of the server. Adjust the directory accordingly to fit where ever the 4.0 version is installed on your PC.

Run this first

Then make sure that your .NET framework is set to allowed in ISAPI and CGI Restrictions by clicking on your server name in IIS manager on the left navigation panel, then click on ISAPI and CGI Restrictions under the IIS section. Once aspx is allowed to run the 4.0 framework your application should work!.