Windows Server 2008 R2 + IIS 7.5 + ASP.NET 4.0 = HTTP 错误 500.0

发布于 2024-09-03 13:59:14 字数 3714 浏览 3 评论 0原文

我很难让 ASP.NET 4.0 以任何方式工作。事实上,我完全擦除了我的服务器,重新安装了 Server 2008 R2 Standard(在 VMWare ESXi 机器上运行,这并不重要),甚至无法让测试 .aspx 页面正常工作。

这正是我所做的:

  1. 安装2008 R2标准
  2. 激活Windows并启用远程桌面
  3. 安装Web服务器角色以及必要的角色服务(常见的http,asp.net,日志记录,跟踪,管理服务和FTP)
  4. 启用管理服务
  5. 已安装。 Net Framework 4.0,通过 Web 可执行文件
  6. 添加 FTP 发布到默认网站
  7. 将默认网站应用程序池切换到 asp.net 4.0(集成)
  8. 将“test.aspx”文件添加到 inetpub\wwwroot 文件夹(内容如下)
  9. 打开浏览器http://localhost/test.aspx 并收到 500.0 错误(也在下面)

我缺少什么?我已经有一段时间(3年多)没有接触过IIS了,所以这可能是一些愚蠢/琐碎的事情。请指出,叫我小白;我的自我可以接受。

谢谢, 戴夫

测试.aspx

<% @Page language="C# %>
 
 <头>
    <标题>Test.aspx
 
 <正文>
    
 
 

错误页面:

Module  AspNetInitClrHostFailureModule
Notification    BeginRequest
Handler PageHandlerFactory-Integrated-4.0
Error Code  0x80070002
Requested URL   http://localhost:80/test.aspx
Physical Path   C:\inetpub\wwwroot\test.aspx
Logon Method    Not yet determined
Logon User  Not yet determined

跟踪:

在我的跟踪文件中我得到:

96. view trace Warning -SET_RESPONSE_ERROR_DESCRIPTION 
ErrorDescription 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.


97. view trace Warning -MODULE_SET_RESPONSE_ERROR_STATUS 
ModuleName AspNetInitClrHostFailureModule 
Notification 1 
HttpStatus 500 
HttpReason Internal Server Error 
HttpSubStatus 0 
ErrorCode 2147942402 
ConfigExceptionInfo  
Notification BEGIN_REQUEST 
ErrorCode The system cannot find the file specified. (0x80070002)

应用程序错误日志显示:

Log Name:      Application
Source:        Microsoft-Windows-IIS-W3SVC-WP
Date:          5/28/2010 2:08:10 PM
Event ID:      2299
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      win-ltfkdo1dnfp
Description:
An application has reported as being unhealthy. The worker process will now request a recycle. Reason given: 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. The data is the error.   

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-IIS-W3SVC-WP" Guid="{670080D9-742A-4187-8D16-41143D1290BD}" EventSourceName="W3SVC-WP" />
    <EventID Qualifiers="49152">2299</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2010-05-28T21:08:10.000000000Z" />
    <EventRecordID>1663</EventRecordID>
    <Correlation />
    <Execution ProcessID="0" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>win-ltfkdo1dnfp</Computer>
    <Security />
 </System>
 <EventData>
 <Data Name="Reason">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.
 </Data>
    <Binary>02000780</Binary>
</EventData>
</Event> 

I am having an impossible time getting asp.net 4.0 to work in any fashion at all. In fact, I completely wiped my server, reinstalled with Server 2008 R2 Standard (running on a VMWare ESXi box, not that it should matter), and cannot even get a test .aspx page to work.

Here is exactly what I did:

  1. Installed 2008 R2 Standard
  2. Activated windows and enabled Remote Desktop
  3. Installed the Web Server Role with the necessary role services(common http, asp.net, logging, tracing, management service and FTP)
  4. Enabled the management service
  5. Installed .Net Framework 4.0 via web executable
  6. Added FTP publishing to the default web site
  7. Switched default web site application pool to asp.net 4.0 (integrated)
  8. Added a 'test.aspx' file to the inetpub\wwwroot folder (contents below)
  9. Opened a browser to http://localhost/test.aspx and received a 500.0 error (also below)

What am I missing? I haven't touched IIS in a while (3+ years), so it could be something stupid/trvial. Please point it out, call me a noob; my ego can take it.

Thanks,
Dave

test.aspx

<% @Page language="C# %>
 <html>
 <head>
    <title>Test.aspx</title>
 </head>
 <body>
    <asp:label runat="server" text="This is an asp.net 4.0 label" />
 </body>
 </html>

Error page:

Module  AspNetInitClrHostFailureModule
Notification    BeginRequest
Handler PageHandlerFactory-Integrated-4.0
Error Code  0x80070002
Requested URL   http://localhost:80/test.aspx
Physical Path   C:\inetpub\wwwroot\test.aspx
Logon Method    Not yet determined
Logon User  Not yet determined

Trace:

And in my trace file I get:

96. view trace Warning -SET_RESPONSE_ERROR_DESCRIPTION 
ErrorDescription 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.


97. view trace Warning -MODULE_SET_RESPONSE_ERROR_STATUS 
ModuleName AspNetInitClrHostFailureModule 
Notification 1 
HttpStatus 500 
HttpReason Internal Server Error 
HttpSubStatus 0 
ErrorCode 2147942402 
ConfigExceptionInfo  
Notification BEGIN_REQUEST 
ErrorCode The system cannot find the file specified. (0x80070002)

The application error log shows:

Log Name:      Application
Source:        Microsoft-Windows-IIS-W3SVC-WP
Date:          5/28/2010 2:08:10 PM
Event ID:      2299
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      win-ltfkdo1dnfp
Description:
An application has reported as being unhealthy. The worker process will now request a recycle. Reason given: 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. The data is the error.   

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-IIS-W3SVC-WP" Guid="{670080D9-742A-4187-8D16-41143D1290BD}" EventSourceName="W3SVC-WP" />
    <EventID Qualifiers="49152">2299</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2010-05-28T21:08:10.000000000Z" />
    <EventRecordID>1663</EventRecordID>
    <Correlation />
    <Execution ProcessID="0" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>win-ltfkdo1dnfp</Computer>
    <Security />
 </System>
 <EventData>
 <Data Name="Reason">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.
 </Data>
    <Binary>02000780</Binary>
</EventData>
</Event> 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

何止钟意 2024-09-10 13:59:15

我在使用 Reflector 调试外部程序集时遇到了同样的问题。

该程序弄乱了我的 DEVPATH 环境变量,我看到了与此处描述的相同的症状。
重置(清空)DEVPATH 解决了这里的问题。

似乎无关,但发现这是OP案例中的问题是如此模糊,我认为值得报告。

I encountered this same problem while using Reflector to debug external assemblies.

The program messed with my DEVPATH environment variable and I saw the same symptoms as described here.
Resetting (emptying) the DEVPATH solved the issue here.

Seems unrelated, but it would be so obscure to find that this is the problem in the OP's case that I think it's worth reporting.

尬尬 2024-09-10 13:59:15

这可能很奇怪..但是单独执行上述操作以及所有其他站点(下面的链接)所说的有关application.host文件更改或在framework和framework64文件夹上执行iisreg..并没有为我解决类似的问题。

我的应用程序可能有一些 32 位依赖项,这也导致了上述错误(而不是像通常那样说错误的二进制格式)
我更改了我的应用程序池以允许 32 位模式(WoW 模式),然后我收到了报告的二进制格式问题..然后我修复了该问题以解决问题

其他有建议的网站:

This might be strange.. but doing the above alone and what all other sites (links below) said about application.host file changes or executing iisreg on framework and framework64 folder .. didnt fix a similar problem for me.

My application probably had some 32 bit dependencies which were also causing the above error (instead of saying wrong binary format as it happens usually)
I changed my application pool to allow 32 bit mode (WoW mode) and then I got the binary format problem reported..which I then fixed to solve the problems

Other sites that had suggestions:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文