28

I know this has been answered a few times but none of the solutions worked for me. I published my ASP.NET MVC 3 application (It was just the internet template without any changes to it) to see if I could get it to work publically. However, when I visit the site it shows up with a 403 error. Coming from a php/linux background, I'm confused and have no clue where to look. I've only been learning .NET for about 8-9 months and everything I've been testing on before was on the local development server through VS2010. It almost appears like the server doesnt know it should be an MVC application or I have to change my routing.

Anyway, I checked to make sure that the server setting is .NET 4. Any help would be greatly appreciated.

ALSO, It's a shared hosting environment using arvixe.

4

7 回答 7

55

For me this did the trick (Original Answer by Mmerrell at Getting 404.0 error for ASP.NET MVC 3 app on IIS 7.0 / Windows Server 2008 )

You actually just reminded me that I needed to fix this issue in an enviroment here. If your situation is the same as mine then it's a simple fix.

Just add the following to your web config:

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

Make sure your have choosen the "ASP.Net 4.0" App-Pool and not the App-Pool created for your application. Make sure your App Pool uses the "ApplicationPoolIdentity" and NOT NetworkService. Remove the NetworkService permission from your root folder. You dont need it. IIS has an built-in identity (IIS_IUSRS).

于 2012-07-19T06:40:27.477 回答
4

403 is a forbidden error. Try checking the NTFS permissions of the folder where you deployed, ensure the Network Service user has read permission

enter image description here

Additionally, check the Authentication and Authorization mechanism in the IIS application:

enter image description here

Edited:

.Net Authorization rules

enter image description here

于 2012-06-15T00:30:42.763 回答
4

I had this same issue after publishing an MVC 4 WebSite to a remote server using FTP Publishing. What ended up working for me was after publishing through Visual Studio, log onto IIS on the remote server, locate the published directory -> right click -> Convert to Application.

Not sure if there is a way to specify this in the web.config/properties, if you don't have access to the server?

于 2012-10-03T00:49:42.483 回答
3

1- verify that your application is running under .NET 4.0 (you did so)

2- check with the hosting company that it supports the MVC 3 framework on their hosting plan.

3- (works) Bin-Deploy your MVC run-time libraries so you may overcome any requirements on the server.

More bout bin-deploy your ASP.NET MVC can be found here: http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx

4- check that "Network Service" has proper access rights to your folder. it basically should have "Read" permission.

于 2012-06-15T00:32:49.537 回答
2

Don't forget about aspnet_regiis.exe -ir.

于 2015-04-27T14:15:18.447 回答
1
<handlers>
  <add name="rewrite" path="*" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
</handlers>

Ask your hosting provider to add this handlers into webconfig

于 2014-10-10T16:37:53.990 回答
0

Try changing the Managed Pipeline Mode of the Application Pool to 'Classic' instead of 'Integrated'. Whilst it may not be the final result that you're after (there can be real advantages in using Integrated mode), at least it will point you in the right direction... if it works.

于 2013-09-09T12:54:01.820 回答