找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 42422|回復: 1
打印 上一主題 下一主題
收起左側

WEB SERVER異常解決方法整理

[復制鏈接]
跳轉到指定樓層
樓主
ID:70976 發(fā)表于 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>

程序在本機上運行是正確的,放在服務器上出現(xiàn)這個問題
解決:出現(xiàn)此問題我目前遇到過兩類:
1、以前版本是Framework1.1,但升級后是2.0此時在服務器端置,選擇控制面版--IIS--選擇網(wǎng)站名稱--右擊屬性--ASP.NET查看版本是否是2.0,如果不是選擇修改后OK。








2、放置系統(tǒng)的服務器本身出現(xiàn)問題并調試后,發(fā)現(xiàn)<解決1>的方法都正常,但問題還是報錯,此時需要重要配置下網(wǎng)站,可以將原有網(wǎng)站移除后重新設置一下一般就OK。
這是我遇到出現(xiàn)此類問題的兩次,大部分還是第一種。

  1.檢查路徑的問題   
  2.IIS應用程序配置   
  3.web.config配置檢查下   
  4.檢查下程序運行環(huán)境(包括.net設置)


ASP.Net錯誤信息 <authentication mode="Windows"/>的解決方法

Line 33:             安全身份驗證模式,以標識傳入的用戶。
Line 34:         -->
Line 35:         <authentication mode="Windows"/>
Line 36:         <!--
Line 37:             如果在執(zhí)行請求的過程中出現(xiàn)未處理的錯誤,則通過 <customErrors> 節(jié)

解決方案:

1、把目錄設置一個獨立站點,不用虛擬目錄。
2、適用虛擬目錄
   在iis下找到你的項目文件夾屬性->目錄->應用程序設置    處    點擊    創(chuàng)建   
   再運行看看。



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是出現(xiàn)以下異常:
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部署到服務器后出現(xiàn)"The test form is only available for requests from the local machine"解決方法

NET Framework 1.1 定義了一個名為 HttpPostLocalhost 的新協(xié)議。默認情況下,這個新協(xié)議處于啟用狀態(tài)。該協(xié)議允許從與使用 HTTP POST 請求的 Web 服務位于同一計算機上的應用程序調用該服務。允許的前提條件是:POST URL 使用 http://localhost,而不是 http://hostname。這使得 Web 服務開發(fā)人員可以使用基于 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> 節(jié)為計算機上的所有 Web 服務啟用這些協(xié)議。下面的示例啟用了 HTTP GET、HTTP POST 及 SOAP,此外還從本地主機啟用了 HTTP POST:
<protocols>
<add />
<add />
<add />
<add />
<!-- Documentation enables the documentation/test pages -->
<add />
</protocols>



您試圖從目錄中執(zhí)行CGI、ISAPI 或其他可執(zhí)行程序...的問題

解決“您試圖從目錄中執(zhí)行CGI、ISAPI 或其他可執(zhí)行程序...”的問題

---------------------------------------------------------
該頁無法顯示
您試圖從目錄中執(zhí)行 CGI、ISAPI 或其他可執(zhí)行程序,但該目錄不允許執(zhí)行程序。

請嘗試以下操作:
  • 如果您認為該目錄應該允許執(zhí)行訪問權限,請與網(wǎng)站管理員聯(lián)系。
HTTP 錯誤 403.1 - 禁止訪問:執(zhí)行訪問被拒絕。
Internet 信息服務 (IIS)

技術信息(為技術支持人員提供)
  • 轉到 Microsoft 產(chǎn)品支持服務并搜索包括“HTTP”和“403”的標題。
  • 打開“IIS 幫助”(可在 IIS 管理器 (inetmgr) 中訪問),然后搜索標題為“配置 ISAPI 擴展”、“配置CGI 應用程序”、“使用網(wǎng)站權限保護站點”和“關于自定義錯誤消息”的主題。
  • 在 IIS 軟件開發(fā)工具包 (SDK) 或 MSDN Online Library 中,搜索標題為“Developing ISAPI Extensions”、“ISAPI and CGI”和“Debugging ISAPI Extensions and Filters”的主題。
-------------------------------------------------------------------------------------------------------
     解決辦法如下:

        單擊操作系統(tǒng)的開始--程序--管理工具--Interneter服務器管理,在IIS中選擇您的站點然后右鍵--屬性,在“主目錄”選項中,查看“執(zhí)行權限”是否設置為“無”,這里改成“純腳本”或者是“腳本和可執(zhí)行文件”保存即可。







分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發(fā)
ID:78485 發(fā)表于 2015-4-29 22:17 | 只看該作者
樓主能加你QQ嗎?
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復 返回頂部 返回列表