我有一个 ASP.NET 4 页面返回 500 错误。这是带有单个 Response.Write 命令的单个页面:
<% Response.Write("Hello World") %>
IIS 7.5
网站的权限是:
SYSTEM
MACHINENAME\myusername
MACHINENAME\Administrators
MACHINENAME\Users
MACHINENAME\IIS_IUSRS
物理路径是:
C:\Users\myusername\Documents\mywebsite
物理路径文件夹的权限为:
SYSTEM
MACHINENAME\myusername
MACHINENAME\Administrators
MACHINENAME\Users
MACHINENAME\IIS_IUSRS
使用托管管道模式:集成为.NET Framework v4.0.30319设置应用程序池。经典模式也已尝试过。
web.config 文件包含以下行:
<authorization>
<allow users="*"/>
</authorization>
<compilation debug="true" targetFramework="4.0">
<assemblies>
</assemblies>
</compilation>
IIS 身份验证设置为匿名身份验证 - 已启用
物理路径> 测试设置显示以下警告:
The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is
NetworkService
orLocalSystem
, verify that<domain>\<computer_name>$
has Read access to the physical path. Then test these settings again.
我已经尝试了所有我读过的方法来解决这个问题,但没有任何改变 500 错误的结果
单个日志条目:
2012-03-22 19:24:16 172.16.35.115 GET /Default.aspx - 80 - 10.1.11.107 Mozilla/5.0+(Windows+NT+6.1;+WOW64;+rv:11.0)+Gecko/20100101+Firefox/11.0 500 21 13 203
这对我来说是新的,我从来没有花这么多时间来加载网页。
我还为 4.0 库(64 位和 32 位版本)添加了 ISAPI 过滤器。
有人可以帮忙吗?
更新
所有研究都让我认为 ASP.NET 4 向 IIS 注册的方式存在问题,并且 aspnet_iisreg
应再次运行实用程序。不幸的是,我还没有获得管理员的许可。
最佳答案
我在 Windows Server 2012 上的 IIS 8 上遇到了同样的问题。 在服务器功能中启用 ASP.NET 4.5 解决了我的问题。
关于iis-7.5 - ASP.NET 4 返回 500 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9829473/