I’m deploying an MVC3 application to a new server. The application runs fine on the development server (Visual Studio) and also under IIS7 on my development machine, but on the server I get a 403 error:

I have completed the following steps, but am now out of ideas. Please help!
- Using the same xcopy deployment technique that I used on my development machine, I have deployed files to the to the server and added the following permissions to the folder:
IUSR – Read & execute, List folder contents, Read
IIS_IUSRS – Read & execute, List folder contents, Read
-
I have also installed ASP.NET MVC3 on server so additional required .dlls are in GAC
-
IIS is set up and I can access basic html files (such as test.html that I have dropped in at the site route).
-
I have checked in Server Manager that all Role Services are installed
-
Have attempted to bin deploy by copying files from MVC install location and putting in the bin directory
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\Assemblies
Ok, found the problem. Here it is incase anyone else has the same issue:
The Server I’m using must have had .NET 4 installed before IIS. This meant that .NET 4 hadn’t been registered with IIS.
I noticed the issue when checking IIS config. Clicking the .NET compilation icon for the website threw an exception, presumably because the application could not be compiled.
This led me to a stack overflow post that directed me to hanselman.com
In short, I had to install VS2010 on the server so I had the Visual Studio command prompt available, and then register .NET 4 with IIS on the command line.
IIS Manager can't configure .NET Compilation on .NET 4 Applications
http://www.hanselman.com/blog/ASPNET4BreakingChangesAndStuffToBeAwareOf.aspx
Key section:
“I installed ASP.NET 4 and then
installed IIS.”
If you install VS2010 and/or .NET 4
first, then later install IIS, you
need make sure IIS is configured to
know about ASP.NET 4 otherwise IIS
will have no idea how to run ASP.NET 4
applications.