10

Scenario: Clean Server 2008 R2 Install with IIS Role.

Installed Framework 3.5 (Server Features) Installed Framework 4.5 RC (MS Download)

executed

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis.exe -i

(I'd use -iru on existing servers but this is a clean build).

Published via File System (SMB share)

Converted the folder into an application using the .Net 4.0 Integrated App Pool

Stopped/restarted everything.

Browsing to localhost/TestApp results in a 403.14 (Directory browsing forbidden)

What step have I missed out? The site in question is MVC4 and targets the 4.5 RC framework

Basic
  • 426
  • 2
  • 9
  • 23
  • Have you made sure you're default document is in the default documents list? – Brent Pabst Jul 06 '12 at 14:23
  • @BrentPabst Being MVC, there isn't a default document - it relies on URL rewriting by IIS to determine which controller/action to execute. If that was failing, I'd expect a different error message. It feels like Url parsing isn't being invoked which _usually_ means .Net isn't registered properly in IIS. Having said that, it _is_ registered and I've installed the appropriate IIS Roles (actually, I've now got _all_ the IIS roles) so I'm a little unsure how best to diagnose this – Basic Jul 06 '12 at 14:39
  • sorry, I'm blind and missed the 4.5 MVC part. Either way, why did you register .NET 4.0 after installing 4.5? I've never actually had to register .NET on any web server because the installer does it automatically. Anyway, I think you registered the wrong .NET handlers. However, with 4.5 and MVC you should at least be seeing a YSOD that says the global ASAX can't be loaded. – Brent Pabst Jul 06 '12 at 15:13
  • @BrentPabst I've had to `aspnet_regiis` before but only when IIS is installed _after_ .Net (seems reasonable). That wasn't the case here but since so many of the suggested answers mention this as the problem, I thought I'd give it a go. 4.5 replace 4.0 entirely. I agree not getting YSOD is odd - As I said, it looks like it's just not treating it as a .Net page at all – Basic Jul 06 '12 at 15:25
  • And when you installed IIS you made sure to include all of the ASP.NET related application programming stuff right? The ASP.NET ISAPI filters are all turned on right? – Brent Pabst Jul 06 '12 at 16:29
  • @BrentPabst I did indeed. In fact, in desperation, I've now installed _every_ IIS module lol. – Basic Jul 06 '12 at 21:04
  • 1
    Glad you got it all worked out. Your head must have been ready to explode! – Brent Pabst Jul 08 '12 at 02:04

2 Answers2

21

I had a similar problem. This thread https://stackoverflow.com/questions/2374957/asp-net-mvc-on-iis-7-5 solved it for me. Basically try adding this to your web.config:

<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/> 
</system.webServer>

If that work you can try removing it and install this hotfix instead: http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=5272

Shildrak
  • 326
  • 2
  • 2
1

The UI is a bit different in the newer versions of Windows Server. Here is where you have to enable ASP.Net in order to get it working on IIS

Fix IIS & Asp.net

kasperd
  • 29,894
  • 16
  • 72
  • 122