.net IIS 为存在的 ASPX 页面返回 404 错误(又名 DllRegisterServer 入口点未找到)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/98895/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 09:59:25  来源:igfitidea点击:

IIS is returning 404 errors for ASPX pages that exist (aka DllRegisterServer entry point was not found)

.netiis

提问by Dexter

I'm having problems refreshing .Net 2.0 with IIS 6.

我在使用 IIS 6 刷新 .Net 2.0 时遇到问题。

I have been able to successfully execute "aspnet_regiis.exe -i", but when I try to register the aspnet_isapi.dll:

我已经能够成功执行“aspnet_regiis.exe -i”,但是当我尝试注册aspnet_isapi.dll时:

regsvr32 “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"

I get the error

我收到错误

C:\Windows..\aspnet_isapi.dll was loaded, but the DllRegisterServer entry point was not found.

The file cannot be registered.

C:\Windows..\aspnet_isapi.dll 已加载,但未找到 DllRegisterServer 入口点。

无法注册文件。

Does anyone know how to resolve this? Google hasn't been very helpful.

有谁知道如何解决这个问题?谷歌并不是很有帮助。

Edit:My problem is actually that IIS isn't serving my webpages properly - that is, it's returning 404s when I try to request .aspx files that I know exist.

编辑:我的问题实际上是 IIS 没有正确地为我的网页提供服务 - 也就是说,当我尝试请求我知道存在的 .aspx 文件时,它返回 404。

I can access .gif and .js files OK, but I can't access .aspx or other .Net files. I know this is related to .Net being properly configured with IIS, and the above commands are supposed to be the solution, but the second command doesn't work.

我可以访问 .gif 和 .js 文件,但我无法访问 .aspx 或其他 .Net 文件。我知道这与 .Net 使用 IIS 正确配置有关,上面的命令应该是解决方案,但第二个命令不起作用。

@aaronjensen: Your command to register scripts worked successfully, and investigating the logs I find that I'm getting an entry for my failed request with status 404, substatus 2.

@aaronjensen:您注册脚本的命令成功运行,并调查了日志,我发现我收到了状态为 404,子状态为 2 的失败请求的条目。

Microsoft tells me this because "Lockdown Policy Prevents This Request".

微软告诉我这是因为“锁定策略阻止了这个请求”。

If a request is denied because the associated ISAPI or CGI has not been unlocked, a 404.2 error is returned.

如果请求因关联的 ISAPI 或 CGI 尚未解锁而被拒绝,则返回 404.2 错误。

Which I assume is due to the isapi DLL in my original query being denied?

我认为这是由于我的原始查询中的 isapi DLL 被拒绝?

回答by Dexter

In the end, I think the problem was caused by a step that is missed by the script when you refresh ASP.Net 2.0 with IIS 6.

最后,我认为问题是由脚本在使用 IIS 6 刷新 ASP.Net 2.0 时遗漏的步骤引起的。

I managed to resolve this using the following steps:

我设法使用以下步骤解决了这个问题:

  • Refresh the install using C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -s /w3svc/1/root

  • Enable ASP.Net Web Service Extension in the IIS 6 Management Console - it looks like the extension was not enabled by default in IIS, hence the 404.2 Lockdown Policy Prevents This Requesterrors that I was seeing. Instructions to enable the ASP.Net webservice extensionare on MSDN.

  • 使用刷新安装 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -s /w3svc/1/root

  • 在 IIS 6 管理控制台中启用 ASP.Net Web 服务扩展 - 看起来该扩展在 IIS 中默认未启用,因此 404.2锁定策略阻止了我看到的此请求错误。MSDN 上提供了启用 ASP.Net Web 服务扩展的说明。

回答by Aaron Jensen

You don't need to register that. Try this as well: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -s /w3svc/1/root

你不需要注册那个。也试试这个:C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -s /w3svc/1/root

If IIS is still giving you issues, check your event log and google the error there. You'll get hits.

如果 IIS 仍然给您带来问题,请检查您的事件日志并在那里搜索错误。你会受到打击。

回答by Adam Pierce

When you get the error, it means either:

当您收到错误时,这意味着:

1 The DLL does not need to be registered

1 DLL不需要注册

or

或者

2 The DLL is corrupt

2 DLL 损坏

回答by dance2die

  1. Check the credential that IIS server is running under.
  2. Check for the AppPool user permission.
  1. 检查运行 IIS 服务器的凭据。
  2. 检查 AppPool 用户权限。

回答by Nikos Tsokos

At first try all the following

首先尝试以下所有

  1. aspnet_regiis.exe -i
  2. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -s /w3svc/1/root
  3. regsvr32 “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
  1. aspnet_regiis.exe -i
  2. C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -s /w3svc/1/root
  3. regsvr32 “C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll”

If it doesnt fix the problem, check event log in computer management because it could also be another issue. My case was an impersonation issue, but it only started to show up in event viewer after i did the aspnet_regiis.

如果它没有解决问题,请检查计算机管理中的事件日志,因为它也可能是另一个问题。我的情况是一个模拟问题,但它只在我执行 aspnet_regiis 后才开始出现在事件查看器中。