设为首页 收藏本站
查看: 4125|回复: 0

[经验分享] IIS Web怪问题: Access is denied due to invalid credentials.

[复制链接]

尚未签到

发表于 2015-8-15 12:58:37 | 显示全部楼层 |阅读模式
  上午还好好可以访问的ASP.NET站点,下午做过一次更新,再访问时,就总是弹出要输入服务器用户名密码对话框(如下图)
   DSC0000.jpg
  如果输入正确,确认三次后,页面报下面的错误:
   DSC0001.jpg
  如果不输用户名密码,直接Cancel,则报下面的错误:
   DSC0002.jpg
  
  记得以前也发生过两次,有一次是重起机器就好了,所以首先想到的就是重起服务器,但是这次重起后竟然还是不行。于是花近两个小时上网查资料,自己也不停尝试改IIS的配置,怀疑有缓存或Log满了之类的原因,但是都不起作用,而且IIS下只有这个站点不能访问,其它站点都没问题,所以肯定不是Server或IIS本身的问题了,尝试了好半天后才想到可能和本次更新有关(真是后知后觉啊),然后隐隐约约记得好像有一次是Skin文件中有问题导致过类型的错误,赶紧打开Skin文件,把最近加的一段Skin代码拿掉,果然就好了。Oh, My God. 然后再仔细一下,和以前唯一不同的地方是在Skin中用<!---->标记加了一句注释。拿掉注释就没问题了

<!--Add By Sammy-->(不能用这样的注释)
<asp:ImageButton SkinID="ImageButtonEditPurple" runat="server" ImageUrl="Images/edit_purple.gif" CssClass="image_button"/>
<asp:ImageButton SkinID="ImageButtonCheckPurple" runat="server" ImageUrl="Images/check_purple.gif" CssClass="image_button"/>  
  真是气人啊,这种错误查起来还真是不容易。
  附1:ASP.NET中的注释符号:

' (single quote)
The single quote character (') introduces a comment line in VB.NET code. It can be used anywhere on a source line. The end of the physical line ends the comment.
Rem
The keyword Rem also introduces a comment in VB.NET code. It can be used anywhere on a source line. The end of the physical line ends the comment.
/* and */
The characters /* and */ open and close respectively a multi-line comment block--the so called regular comment--in C# code. Regular comments can span over a section of a line, a single line, or multiple lines.
//
The double slash characters (//) introduce a one-line comment in C# code and can be placed anywhere on a source line. The one-line comment extends to the end of the line. Equivalent to ' and Rem in VB.NET.
///
The comments introduced by tripple slash characters (///) are a C#-specific feature. By means of XML markup you can document your code (e.g. is used for describing parameters). If you run the compiler with the /doc option, it automatically generates an XML documentation file.
<!-- and -->
The characters <!-- and --> are standard HTML (adopted from SGML) comment delimiters. Note, that the comment text is sent to the browser and thus visible outside (source code).
<%-- and --%>
Server-Side Comments (<%-- --%>) enable ASP.NET page developers to prevent server code (including server controls) and static content from executing/rendering. They assume a similar role to the standard HTML comments with the smashing difference that the text of the comment is not sent to the browser.   
  附2:别人因其它原因遇到类似问题的解决方案:

首先可能是你的log满了,解决办法是
保存并清除日志
打开注册表编辑器,将
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\CrashOnAuditFail的键值设置成1
重启服务器
还有可能是Kerberos认证引起的,解决办法是
如果使用Kerberos认证,在命令提示符下运行SetSPN -A HTTP/主机头 服务器主机名
如果不使用,在命令提示符下运行cscript adsutil.vbs set w3svc/NTAuthenticationProviders "NTLM"  
  

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-99387-1-1.html 上篇帖子: windows中IIS7配置PHP(FastCGI模式-PHP在IIS下运行最高效最稳定的模式) 下篇帖子: IIS访问WEB遇到 System.Data.OracleClient 需要 Oracle 客户端软件 8.1.7 或更高版本。问题解决方案。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表