IIS 5 上的 ASP.NET 2.0 应用程序导致错误(aspnet_wp.exe (PID: XXXX) 意外停止。)
在 Windows 2000 服务器 (IIS 5) 上托管 ASP.NET 2.0 Web 应用程序后。 我无法浏览该网站。
浏览器上显示以下错误消息,并添加了三个事件日志条目...
浏览器上的错误消息
服务器应用程序不可用 您尝试访问此 Web 服务器上的 Web 应用程序当前不可用。 请点击网络浏览器中的“刷新”按钮重试您的请求。
事件日志条目
事件类型:错误
事件来源:ASP.NET 2.0.50727.0
活动类别:无
事件 ID:1000
日期:2008年10月24日
时间:下午 3:45:26
用户:不适用
计算机:XXXXX
描述:aspnet_wp.exe(PID:XXXX)意外停止。事件类型:错误
事件来源:ASP.NET 2.0.50727.0
活动类别:无
事件ID:1088
日期:2008年10月24日
时间:下午 3:45:26
用户:不适用
计算机:XXXXX
描述:无法执行请求,因为无法创建应用程序域。 错误:0x80070005 访问被拒绝。事件类型:警告
事件来源:ASP.NET 2.0.50727.0
活动类别:无
事件 ID:1073
日期:2008年10月24日
时间:下午 3:45:26
用户:不适用
计算机:WEBDEV
说明:无法初始化 AppDomain:/LM/W3SVC/1/Root/WebApplicationName
异常:System.IO.FileLoadException
消息:无法加载文件或程序集“System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a”或其依赖项之一。 访问被拒绝。 StackTrace:位于 System.Reflection.Assembly.nLoad(AssemblyName fileName、String codeBase、Evidence assemblySecurity、Assembly locationHint、StackCrawlMark& stackMark、Boolean throwOnFileNotFound、Boolean forIntrospection)
在 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef、Evidence assemblySecurity、StackCrawlMark& stackMark、Boolean forIntrospection)
在 System.Reflection.Assembly.InternalLoad(字符串 assemblyString,证据 assemblySecurity,StackCrawlMark& stackMark,布尔值 forIntrospection)
在System.Activator.CreateInstance(字符串程序集名称,字符串类型名称,布尔忽略大小写,BindingFlags绑定Attr,活页夹活页夹,对象[]参数,CultureInfo文化,对象[]激活属性,证据安全信息,StackCrawlMark&stackMark)
在 System.Activator.CreateInstance(String assemblyName, String typeName)
在 System.AppDomain.CreateInstance(字符串程序集名称,字符串类型名称)
在 System.AppDomain.CreateInstance(字符串程序集名称,字符串类型名称)
在 System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(字符串 appId,IApplicationHost appHost,HostingEnvironmentParameters 托管参数)
在 System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironmentAndReportErrors(字符串 appId,IApplicationHost appHost,HostingEnvironmentParameters 托管参数)
任何想法...
**编辑 **
为什么访问 System.Web 程序集会抛出 System.IO.FileLoadException ?
After hosting an ASP.NET 2.0 web application on a windows 2000 server(IIS 5).
I was unable to browse the web site.
The following error message was displayed on the browser and three Event Log entries were added...
Error Message on Browser
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.
Event Log Entries
Event Type: Error
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1000
Date: 10/24/2008
Time: 3:45:26 PM
User: N/A
Computer: XXXXX
Description: aspnet_wp.exe (PID: XXXX) stopped unexpectedly.Event Type: Error
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1088
Date: 10/24/2008
Time: 3:45:26 PM
User: N/A
Computer: XXXXX
Description: Failed to execute request because the App-Domain could not be created. Error: 0x80070005 Access is denied.Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1073
Date: 10/24/2008
Time: 3:45:26 PM
User: N/A
Computer: WEBDEV
Description: Failed to initialize the AppDomain:/LM/W3SVC/1/Root/WebApplicationName
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. Access is denied.
StackTrace: 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)
Any Ideas...
** Edit **
And Why System.IO.FileLoadException is thrown for accessing System.Web assembly ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我发现当网站文件夹被复制到服务器时,它继承了父文件夹的安全权限,而父文件夹只有管理员、管理员和管理员的权限。 系统账户。
我添加了
和 Read & 执行、列出文件夹内容和读取权限。
即使问题已解决,我仍然有一些问题
从第三个事件日志条目可以清楚地看出,ApplicationManager 无法创建 System.Web 程序集中的 HostingEnvironment。
由于 System.Web 抛出 FileLoadException ,因此 ASP.NET 工作进程似乎无权访问 GAC 文件夹。
为什么访问 System.Web 会抛出 FileLoadException?
I discovered that when the web site folder was copied to the server it inherited the security permissions of the parent folder which only had permission for the Administrator, Administrators & System accounts.
I added
With Read & Execute, List Folder Contents and Read permissions.
Even though the problem is resolved I still have some questions
It's clear from the third event log entry that the ApplicationManager fails to create the HostingEnvironment which is in the System.Web assembly.
Since FileLoadException is thrown for System.Web it seems like the ASP.NET worker process doesn't have access to the GAC folder.
Why is the FileLoadException thrown for accessing System.Web?
从表面上看,您的 ASP.NET 安装权限设置不正确。 通常最好的选择是卸载并重新安装 ASP.NET 部分。 您可以通过以下操作轻松完成此操作。
这将卸载 ASP.NET 并重新安装,即然后应该为该帐户建立适当的权限。
From the looks of it you have an incorrect permission set for your ASP.NET installation. Typically the best bet it to just uninstall and re-install the ASP.NET portion. You can do this easily by the following.
That will uninstall ASP.NET and re-install, that should then establish the proper permissions for the account.
此错误意味着您的代码引发了异常,导致 IIS 崩溃或强制关闭。 导致此问题的常见异常是 OutOfMemoryException 和 StackOverflowException。
您收到 FileLoadException,但可能存在潜在的 OutOfMemoryException 或类似异常,这实际上是其根本原因。 如果不知道您要加载的内容以及其中的代码,就不可能判断到底是什么导致了您的问题。
不过,为了排除加载组件的问题,我要做的第一件事就是尝试在测试工具中反映它,看看是否会发生同样的问题。 如果是这样,则问题出在您尝试加载的 DLL 上,而不是 IIS 上。
This error means that your code has thrown an exception that has either crashed IIS, or forced it to shut down. Common exceptions that cause this are OutOfMemoryException and StackOverflowException.
You're getting a FileLoadException, but there could be an underlying OutOfMemoryException or similar that's actually the root cause of that. Without knowing what you're trying to load, and the code that's inside it, it's impossible to tell what's actually causing your problem.
The first thing I would do to rule out a problem with the loading assembly, though, is to try and reflect over it in a test harness and see if the same problem happens. If so, then the problem is with the DLL that you're trying to load, not IIS.
我遇到了同样的问题,但它并没有随着 -u 和 -i 的 aspnet_regiis 消失,许多其他人建议 此处。
但是,在我清理“%windir%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files”文件夹并从 web.config 中的身份模拟部分向用户授予该文件夹读写权限后,问题消失了。 向本地 ASPNET 用户授予这些权限是不够的。
I had the same problem and it didn't go away with aspnet_regiis with -u and -i and many others suggested here.
But after I cleaned “%windir%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files” folder and gave this folder read-write permissions to user from identity impersonate section in web.config, problem disappeared. It was not sufficient to give local ASPNET user those rights.