MVC4 本地正常运行,发布到IIS7->403 - 禁止访问: 访问被拒绝。
2015-03-16 17:19
330 查看
原文:MVC4 本地正常运行,发布到IIS7->403 - 禁止访问: 访问被拒绝。 上周五代码编写完成,计划发布一个版本测试,没想到发布到IIS7 竟然报错“403-禁止访问”。还真第一次遇到这种问题。。。。。
、
折腾了半天,终于解决。
1、提示报错403:
禁止访问: 访问被拒绝。您无权使用所提供的凭据查看此目录或页面。”
解决方案-在<system.webServer>后加上:<modules runAllManagedModulesForAllRequests="true"/>
2、有了第一步,出现的问题也不一样,很开心,至少有进展
“Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
”
如图:
3、按错误提示webconfig 加上:<customErrors mode="Off"/>
4、好像越来越明朗了
下载“Microsoft.Web.Infrastructure.dll”。DLL放入到Bin文件夹下。
大功告成
后记:找了原因所在,自己也在想是什么原因:之前一直MVC+EF来开发,后来发现要吐槽一点点EF就换到了ADO。改成了MVC4+ADO.NET 没有安装基础包。。。。
、
折腾了半天,终于解决。
1、提示报错403:
禁止访问: 访问被拒绝。您无权使用所提供的凭据查看此目录或页面。”
解决方案-在<system.webServer>后加上:<modules runAllManagedModulesForAllRequests="true"/>
2、有了第一步,出现的问题也不一样,很开心,至少有进展
“Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
”
如图:
3、按错误提示webconfig 加上:<customErrors mode="Off"/>
4、好像越来越明朗了
下载“Microsoft.Web.Infrastructure.dll”。DLL放入到Bin文件夹下。
大功告成
后记:找了原因所在,自己也在想是什么原因:之前一直MVC+EF来开发,后来发现要吐槽一点点EF就换到了ADO。改成了MVC4+ADO.NET 没有安装基础包。。。。
相关文章推荐
- MVC4 本地正常运行,发布到IIS7->403 - 禁止访问: 访问被拒绝。
- MVC4 本地正常运行,发布到IIS7->403 - 禁止访问: 访问被拒绝。
- IIS7中发布网站到公网技巧与排错--服务器错误 403-禁止访问:访问本拒绝。
- 2008 Server IIS7 403 - 禁止访问: 访问被拒绝
- 2008 Server IIS7 403 - 禁止访问: 访问被拒绝
- IIS7 MVC 403 禁止访问:访问被拒绝
- mvc 发布后 css一些文件访问出403 禁止访问: 访问被拒绝问题
- silverlight网站,访问Oracle数据库,VS2012中运行正常,发布后无法访问。
- was发布的jsp(hibernate,spring)访问的时候界面提示403禁止访问错误
- winserver2003环境发布ASP程序报错(HTTP 错误 403.1 - 禁止访问:执行访问被拒绝)
- 本地打印后台处理程序服务没有运行和windows无法连接到打印机拒绝访问
- 解决MVC4发布在IIS7后,路径无法访问.apk文件的解决方法
- Apache2.4.9本地访问正常但是在局域网或外网IP拒绝访问
- 关于java web项目在本地运行正常 但发布到云上后在某些浏览器打开会有问题的原因及解决
- 本地环境 Ubuntu 下安装XAMPP,phpmyadmin无法正常访问解决办法 &lt;转&gt;
- 爬虫发起抓取被服务器拒绝访问返回403禁止访问解决方案
- MVC本地运行正常,发布之后报错 0x80131040
- 403 – 禁止访问: 访问被拒绝
- win7下,发布到iis上,本地可以正常访问,远程访问失败
- php的保护:禁止直接访问 但网站可正常运行