找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 41588|回复: 1
打印 上一主题 下一主题
收起左侧

WEB SERVER异常解决方法整理

[复制链接]
跳转到指定楼层
楼主
ID:70976 发表于 2014-12-26 00:21 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式


Runtime Error---Description: An application error occurred on the server....
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".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>

程序在本机上运行是正确的,放在服务器上出现这个问题
解决:出现此问题我目前遇到过两类:
1、以前版本是Framework1.1,但升级后是2.0此时在服务器端置,选择控制面版--IIS--选择网站名称--右击属性--ASP.NET查看版本是否是2.0,如果不是选择修改后OK。








2、放置系统的服务器本身出现问题并调试后,发现<解决1>的方法都正常,但问题还是报错,此时需要重要配置下网站,可以将原有网站移除后重新设置一下一般就OK。
这是我遇到出现此类问题的两次,大部分还是第一种。

  1.检查路径的问题   
  2.IIS应用程序配置   
  3.web.config配置检查下   
  4.检查下程序运行环境(包括.net设置)


ASP.Net错误信息 <authentication mode="Windows"/>的解决方法

Line 33:             安全身份验证模式,以标识传入的用户。
Line 34:         -->
Line 35:         <authentication mode="Windows"/>
Line 36:         <!--
Line 37:             如果在执行请求的过程中出现未处理的错误,则通过 <customErrors> 节

解决方案:

1、把目录设置一个独立站点,不用虚拟目录。
2、适用虚拟目录
   在iis下找到你的项目文件夹属性->目录->应用程序设置    处    点击    创建   
   再运行看看。



ASP.NET 站点出错 NT AUTHORITY\NETWORK SERVICE) does not have write access to Temporary ASP.NET Files

出错信息如下:Server Error in '/' Application.
The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:


[HttpException (0x80004005): The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.]
   System.Web.HttpRuntime.SetUpCodegenDirectory(CompilationSection compilationSection) +3482363
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags) +226

[HttpException (0x80004005): The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3434991
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +252


原因是公司IT因为其它原因修改了目录的权限设置,按照提示修改改权限设置即可。原来NetworkService对Temporary ASP.NET 有写的权限。
如果调用WebService是出现以下异常:
System.InvalidOperationException: Unable to generate a temporary class(result=1). error CS2001: Source file 'C:\WINNT\TEMP\gggcyckb.0.cs' could not be found error CS2008: No inputs specified at System.Xml.Serialization.Compiler.Compile() at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings) at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings) at System.Web.Services.Protocols.SoapClientType..ctor(Type type) at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor() at SDAccounts.swd_dotnetdev.Organizations..ctor() at SDAccounts.Contacts.GetContactInfo(Object Status, Object& ErrorString) 表明看起来是无法找到源文件,实际上是asp.net的运行帐户对Windows\temp\目录没有写入的权限,加入权限后问题解决




Service部署到服务器后出现"The test form is only available for requests from the local machine"解决方法

NET Framework 1.1 定义了一个名为 HttpPostLocalhost 的新协议。默认情况下,这个新协议处于启用状态。该协议允许从与使用 HTTP POST 请求的 Web 服务位于同一计算机上的应用程序调用该服务。允许的前提条件是:POST URL 使用 http://localhost,而不是 http://hostname。这使得 Web 服务开发人员可以使用基于 HTML 的测试窗体,从 Web 服务所在的同一计算机调用该 Web 服务。
当您尝试从远程计算机访问 Web 服务时,不会显示“调用”按钮。并且,您会收到以下错误信息:

The test form is only available for requests from the local machine
解决方法:
1.通过编辑 Web 服务所在的 vroot 的 Web.config 文件,可以启用 HTTP GET 和 HTTP POST。以下配置同时启用了 HTTP GET 和 HTTP POST:
  <configuration>
    <system.web>
    <webServices>
        <protocols>
            <add />
            <add />
        </protocols>
    </webServices>
    </system.web>
</configuration>
2.通过编辑 Machine.config 中的 <protocols> 节为计算机上的所有 Web 服务启用这些协议。下面的示例启用了 HTTP GET、HTTP POST 及 SOAP,此外还从本地主机启用了 HTTP POST:
<protocols>
<add />
<add />
<add />
<add />
<!-- Documentation enables the documentation/test pages -->
<add />
</protocols>



您试图从目录中执行CGI、ISAPI 或其他可执行程序...的问题

解决“您试图从目录中执行CGI、ISAPI 或其他可执行程序...”的问题

---------------------------------------------------------
该页无法显示
您试图从目录中执行 CGI、ISAPI 或其他可执行程序,但该目录不允许执行程序。

请尝试以下操作:
  • 如果您认为该目录应该允许执行访问权限,请与网站管理员联系。
HTTP 错误 403.1 - 禁止访问:执行访问被拒绝。
Internet 信息服务 (IIS)

技术信息(为技术支持人员提供)
  • 转到 Microsoft 产品支持服务并搜索包括“HTTP”和“403”的标题。
  • 打开“IIS 帮助”(可在 IIS 管理器 (inetmgr) 中访问),然后搜索标题为“配置 ISAPI 扩展”、“配置CGI 应用程序”、“使用网站权限保护站点”和“关于自定义错误消息”的主题。
  • 在 IIS 软件开发工具包 (SDK) 或 MSDN Online Library 中,搜索标题为“Developing ISAPI Extensions”、“ISAPI and CGI”和“Debugging ISAPI Extensions and Filters”的主题。
-------------------------------------------------------------------------------------------------------
     解决办法如下:

        单击操作系统的开始--程序--管理工具--Interneter服务器管理,在IIS中选择您的站点然后右键--属性,在“主目录”选项中,查看“执行权限”是否设置为“无”,这里改成“纯脚本”或者是“脚本和可执行文件”保存即可。







分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:78485 发表于 2015-4-29 22:17 | 只看该作者
楼主能加你QQ吗?
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

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