MVC4 HTTP Error 403.14 - Forbidden
Solution 1
Try
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Via
https://serverfault.com/questions/405395/unable-to-get-anything-except-403-from-a-net-4-5-website
Solution 2
Error 403.14 is the HTTP error code for not being allowed to list the contents of a directory. Please be sure that
- You have setup the website as an application in IIS
- You have .NET 4.5 installed on the server
- You have set the application pool to run the proper version of the .NET framework (ie. it is not set to .NET 2.0
- You are using the integrated pipeline on your application pool
- .NET 4.5 is actually registered in IIS. Please see this post for a similar issue/resolution
Usually, a and d are the biggest issues surrounding MVC deployments to IIS
Solution 3
Perhaps... If you happen to use the Publish Wizard (like I did) and select the "Precompile during publishing" checkbox (like I did) and see the same symptoms...
Yeah, I beat myself over the head, but after unchecking this box, a seemingly unrelated setting, all the symptoms described go away after redeploying.
Hopefully this fixes some folks.
Solution 4
Windows-> Start -> Turn widows features on and off
Make sure you check required options in
Solution 5
Before applying
runAllManagedModulesForAllRequests="true"/>
consider the link below that suggests a less drastic alternative. In the post the author offers the following alteration to the local web.config:
<system.webServer>
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html
mithun_daa
.Net dev for over 5 yrs dabbling with Rails/jQuery/Ubuntu
Updated on August 27, 2021Comments
-
mithun_daa over 2 years
I have build a .net4.5 ASP.NET MVC4 web app which works fine locally (IIS Express & dev server) but once i deploy it to my web server it throws the 403 error. I have installed .Net 4.5RC on the server and even tried the
aspnet_regiis -i
bit that everyone recommended for their issues with previous versions of MVC/.Net but it did not help.Any ideas?
EDIT: More info about the situation. The server is 32bit and I have 4 other MVC3 applications that work fine. It is just my MVC4 app that is not working.
-
mithun_daa almost 12 yearsI am sorry but i did not follow what you meant. This is a 32bit server. I have updated my post to add more info.
-
mithun_daa almost 12 years1. I have not setup the website as an application. 2. I have .net 4.5 installed, 3.had my app pool targeting the correct framework. 4. My pool was set to use classic, changed it to Integrated but didn't help. 5. I am pretty sure 4.5 is registered.
-
Tommy almost 12 years@mithun_daa - If you have not setup your website as an application, its pretty easy -> right click the virtual directory/website and Convert To Application (or add Application, terminology escapes me at the moment)
-
mithun_daa almost 12 yearsIs this a MVC4 specific thing? Cause I have never set up my MVC3 projects as Applications and they work just fine.
-
MarkKGreenway almost 12 yearsAhhh ... Are they in separate app_pools?
-
mithun_daa almost 12 yearsYes, infact each of my sites have their own app pools.
-
Tommy almost 12 yearsCould be how you are deploying then -> but any .NET web application must be set as an application in IIS. However, if you are just putting these under the default website, then it is running under the default website application. Make sure that the application pool of the default website is configured correctly (.NET 4/integrated). When you create a virtual directory/virtual website in IIS, you have the option of setting it to its own application as well.
-
mithun_daa almost 12 yearsI probably confused you but none of the sites are under the Default Web site. I right click "Sites" in IIS7 and choose "Add Web Site". That is how i have been doing.
-
Maxim V. Pavlov over 11 yearsHad that in place, did everything, and still only MVC 4 sites work. There has to be some other trick that needs to be in place for this to work.
-
Julia Hayward over 11 yearsThis. Tried all the other stock solutions with no joy but this was the one that sorted the problem.
-
A.Dara about 10 yearsDear friend, I do it, but it doesn't work. Really, I was working with MVC 4 and VisualStudio 2012, my project works well until yesterday, but after some usual changes in my codes, this error rise in default page (home/index). can any body help me please?..
-
Ahmad Ibrahim about 10 yearsThis fix is Not appropriate for this problem (see the link in Jason Koopmans answer). much better is downloading the related hotfix here microsoft.com/en-us/download/…
-
MarkKGreenway about 10 years@AhmadIbrahim it is in fact a solution to the problem. The fix is for 64bit only, the question clearly states 32bit. There are certain configurations for which RAMMFAR is the most reliable working solution, and adds minimal server load if CDN's are appropriately used.
-
devnull about 10 yearsWhy post the same answer at multiple places?
-
Mastro about 10 yearsBecause I was trying to track down the solution, and it pertains to both. Save someone from hunting it around.
-
devnull about 10 yearsYou shouldn't be posting duplicate answers. That's all I can say.
-
Ahmad Ibrahim about 10 years@MarkKGreenway I think there's a 32-bit version of the fix here microsoft.com/en-us/download/details.aspx?id=11342
-
Ahmad Ibrahim about 10 years@MarkKGreenway you think that this case is one of the certain configurations for which RAMMFAR is the most reliable working solution ?
-
tristankoffee about 9 yearsFor me, I discovered long ago that I can enter
null
for thename
parameter to avoid making up a name for every route. It turns out that this also causes a 403 sometimes (only on our prod environment, Win Server 2008 R2 running .NET 4.5.1, MVC 5 in a VS2013 project. To resolve I added a name for each route. -
chdev77 almost 9 yearsThis was our fix for Server 2002 and IIS 7. Our lower environments are Server 2012 with IIS 8, we deployed without setting the modules
runAllManagedModulesForAllRequests="true"
. Luckily after getting the 403 many times and more stackoverflow searching I found this thread. So, settingrunAllManagedModulesForAllRequests="true"
on Server 2002 with IIS 7 solve our problems....and made for a long deployment night. -
Slight over 8 years-1 No attempt to explain why the solution works, link itself doesn't even explain it. Bad solution in general (huge performance penalty, not scalable). You should almost never need RAMMFAR other than debugging purposes.
-
MarkKGreenway over 8 years@Slight RAMMFAR only has negative impact on things that would not be delivered via asp.net such as static content other modules. More info : weblog.west-wind.com/posts/2012/Oct/25/…
-
Slight over 8 years@MarkKGreenway Yes, that's what I was referring to. Is that not what's happening here? With that option on, static files will invoke the pipline no?
-
Spivonious over 7 yearsThis is the real answer. Thanks!
-
Ishmael over 7 yearsI don't feel this is worth an answer on it's own, but make sure you haven't accidentally added a folder to your site at one of your controller routes :).
-
ValGe about 7 yearsIf you are having this a possible root cause is having a different version of an external library in the production environment. I had my mvc app compiled against a newer version of a 3rd party dll and an older version in the production server..
-
Ortund almost 7 years@MarkKGreenway you saved my neck. I had ALL of my MVC sites go down and doing this fixed it. A lynch mob was forming but then I found your answer phew! What I'd like to know, though, is what could have changed on my server to make this necessary since all sites were working before...
-
Ortund almost 7 years@MarkKGreenway you saved my neck. I had ALL of my MVC sites go down and doing this fixed it. A lynch mob was forming but then I found your answer phew! What I'd like to know, though, is what could have changed on my server to make this necessary since all sites were working before...
-
Luis Villarroel over 5 yearsHere's to the boy wonder, the kid, the miracle man, the phenomenon, the unstoppable, the king, here's to @Brian Kirkpatrick ladies and gentleman