随笔 - 118,  文章 - 5,  评论 - 15,  阅读 - 17万

代码编写完成,计划发布一个版本测试,没想到发布到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”。并把复制到本地改为“True”

 

大功告成

转自:http://www.cnblogs.com/PEPE/p/4341379.html?utm_source=tuicool&utm_medium=referral

posted on   mrma1989  阅读(2509)  评论(0编辑  收藏  举报
编辑推荐:
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示