开发者

Publish a basic MVC3 application, access is denied

开发者 https://www.devze.com 2023-02-12 08:34 出处:网络
I just made my first MVC3 app, and I thought it would be fun to upload it to my web hotell. So I did a publish locally in visual studio and then transfered the published files to them over ftp. They h

I just made my first MVC3 app, and I thought it would be fun to upload it to my web hotell. So I did a publish locally in visual studio and then transfered the published files to them over ftp. They have support for MVC3, so there shouldn't be any problems there. But what I get when I try to go the the page I get an 403 - Forbidden: Access is denied

Please help, I've tried to add the:

  <authorizati开发者_C百科on>
  <allow users="*"/>
  <deny users="?"/>
</authorization>

Thank you!


This looks like some misconfiguration of the application in IIS. Try setting the application pool to run in Integrated Mode (vs Classic Mode). Also try bin deploying in case your hosting provider doesn't have MVC 3 installed on the server.

Remark: you absolutely don't need the <authorization> tags in your web.config. That's no longer used in MVC. Authorization in ASP.NET MVC is handled by decorating your controllers/actions with the [Authorize] attribute.


Try to add this in web.config:

<modules runAllManagedModulesForAllRequests="true">
 <remove name="ServiceModel"/>
 <add name="mvc" type="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll"/>
</modules>


I usually get this error when for some reason routing is not configured right in IIS, are you certain that your host supports MVC 3?

0

精彩评论

暂无评论...
验证码 换一张
取 消