现在的位置: 首页 > 综合 > 正文

Failed to execute request because the App-Domain could not be created. Error: 0×80131902 (方法2)

2013年02月25日 ⁄ 综合 ⁄ 共 3283字 ⁄ 字号 评论关闭
天把vs2005開發的網站發佈到本機IIS測試,因之前配置iis開啟php擴展沒配好,iis不能用,只好重新安裝iis.可是重新安裝iis之後,還是報錯,這個錯誤還沒有遇到過,頁面提示內容如下:

具体情况如下:
Server Application Unavailable

The web application you are attempting to access on this web server is currently unavailable. Please hit the “Refresh” button in your web browser to retry your request.

Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.

 

到事件查看器里查看應用程式事件,發現有兩個錯誤,具體如下:

1.

Failed to execute request because the App-Domain could not be created. Error: 0x80070005 存取被拒.

 

2.

Failed to initialize the AppDomain:/LM/W3SVC/1549957242/Root

Exception: System.IO.FileLoadException

Message: Could not load file or assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. 存取被拒。

StackTrace:    at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(String assemblyName, String typeName)
   at System.AppDomain.CreateInstance(String assemblyName, String typeName)
   at System.AppDomain.CreateInstance(String assemblyName, String typeName)
   at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
   at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)

 

 

看到就頭暈,還是先百度一下,結果發現有很多人有出現過這種情況,于是一個一個點開來看想找到原因.

最開始是看有提示頁面錯誤和我一樣的人的解決方法,來來去去就是一個方法給大家轉來轉去,說是安裝好第一次使用比較可能發生此錯誤,即沒有註冊好,要重新註冊,方法如下:

1.首先開啟「命令視窗」,並切換目錄到 %SystemRoot%\Microsoft.Net\Framework\(%SystemRoot% 視你 Windows 安裝目錄而定,一般是在 C:\Windows)

2.執行 "net stop w3svc" 終止 w3svc 服務
3.切換到下層目錄 v2.0.5.xxx
4.執行 "aspnet_regiis.exe -ua" 解除 .Net 安裝
5.重新安裝 .Net 到 IIS 中 "aspnet_regiis.exe -i"
6.重新啟動 w3svc "net start w3svc".

 

但是還沒有找到原因是甚麼,於是再找,後來找到一篇有補充的,說執行"aspnet_regiis.exe -ua",會卸載全部asp.net的版本,不管是在那個版本的目錄下面執行此命令(這裡提醒一下,如果想要多個版本同時存在,慎用).我的暫時就只要v.2.0的就可以了.

看了好几篇都一樣,還是想把問題解決先,然後在繼續找原因.於是按上面步驟操作一遍,當我滿懷希望地在瀏覽器上刷新畫面時,結果卻還是提示原來的錯誤.鬱悶...........................

只好繼續找.後來找到答案,果然是iis沒有配置好,權限問題.權限問題還一直沒有弄明白.一開始我懷疑是權限問題,把"ISUR_電腦名 " 和 "IWAM_電腦名"這兩個網絡帳號的權限設定為完全控制,但是還不行,就不知道是哪裡出問題了.後來那篇文章說先把"Everyone"的權限全開,如果可以訪問,就是權限問題了,我沒有把"Everyone"的權限全開,只是默認的只讀和執行,還真的能訪問了,驚喜,於是按上面的方法把 "aspnet" 和 "iis_wpg"兩個帳號的權限也開了,只用默認的只讀和執行,然後把"Everyone"刪掉,依然能訪問,然後我再將"ISUR_電腦名 " 和 "IWAM_電腦名"這兩個帳號的權限也設置成只讀和執行,也一樣可以訪問.反覆試了几次,最後保留了"ISUR_電腦名 "(我在匿名訪問時是使用此帳號來登陸的),"aspnet" 和 "iis_wpg"這三個帳號的只讀和執行權限,可以正常訪問.哈哈,問題解決

抱歉!评论已关闭.