I fought with IIS8 and ASP.NET 4.5 way longer than I should have had to this morning.
Per previous lessons learned, I used WebPI to install IIS and the recommended configuration. I also selected .NET 4.5 and Web Deploy. Afterward I threw up a simple Hello World type ASP.NET page but when I hit it I got this error:
HTTP Error 404.17 – Not Found
The requested content appears to be script and will not be served by the static file handler.
I checked the application pool and saw that it was set to 4.0. I also checked under Roles-IIS and confirmed that the server thought ASP.NET 4.x was installed. Yet obviously something wasn’t working properly. If I changed the application pool to 2.0 the test page loaded fine.
After a bunch of troubleshooting trying to figure this out, I decided to step back into WebPI and see if I could reinstall 4.5 that way. While it doesn’t allow a “reinstall” I did notice that the “IIS: ASP.NET 4.5” component was showing as available for install. Hmm. Worth a shot.
So I let it run through that install, tested again, and the test page worked. Yeah! It seems like there might be some sort of failure or bug in this process since IIS thought 4.x should work yet it seems that there were no mappings set up until I did the additional component install.
(BTW – I tested this on two different fresh Windows Server 2012 installations, so it wasn’t just one bad build.)
Well, lesson learned and I’ll get through this a lot faster next time. Hopefully this saves someone else hours of troubleshooting and allows them to get on with their coding.