简体   繁体   English

“由于扩展​​配置,无法提供您请求的页面。” 错误信息

[英]“The page you are requesting cannot be served because of the extension configuration.” error message

I'm getting this error message when trying to run my application.尝试运行我的应用程序时收到此错误消息。 I don't know how to fix it:我不知道如何修复它:

HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. HTTP 错误 404.3 - Not Found 由于扩展配置,无法提供您请求的页面。 If the page is a script, add a handler.如果页面是脚本,则添加处理程序。 If the file should be downloaded, add a MIME map.如果应该下载文件,请添加 MIME 映射。

Here's a screenshot of the error page:这是错误页面的屏幕截图:替代文字

What can I do to fix this error?我能做些什么来修复这个错误?

In Windows 8/10, you have to use在 Windows 8/10 中,您必须使用

  • Open Control Panel →打开控制面板 →
  • Programs and Features →程序和功能 →
  • Turn Windows features on or off →打开或关闭 Windows 功能 →
  • Internet Information Services (IIS) → Internet 信息服务 (IIS) →
  • World Wide Web Services →万维网服务 →
  • Application Development Features →应用程序开发功能 →
  • Check the appropriate items, such as enabling ASP.NET.检查适当的项目,例如启用 ASP.NET。 (ie install the appropriate version you want to configure your websites with) (即安装您想要配置网站的适当版本)

Reference: Check the solution of this question for reference参考: 查看此问题的解决方案以供参考

Use aspnet_regiis.exe to register version of .NET framework you are using.使用aspnet_regiis.exe注册您正在使用的 .NET 框架版本。

This is a common issue and happens when IIS is installed after VS or .NET framework.这是一个常见问题,在 VS 或 .NET 框架之后安装 IIS 时会发生。

Note - for Windows 8/10 users, see the other answer by JohnOpincar below .注意 - 对于 Windows 8/10 用户,请参阅下面 JohnOpincar 的其他答案 And also the comment/tip from Kevin Brydon.还有来自 Kevin Brydon 的评论/提示。

I fixed that on my Windows 10:我在 Windows 10 上修复了这个问题:

  1. Go to Control Panel - Programs and Features - Turn Windows features on or off.转到控制面板 - 程序和功能 - 打开或关闭 Windows 功能。

  2. Select .NET Framework 4.6 Advanced Services - WCF Services选择 .NET Framework 4.6 高级服务 - WCF 服务

  3. Check HTTP Activation.检查 HTTP 激活。

  4. OK done. OK完成。

In my case I needed to add MIME types for each file extension that I wanted to serve to web config:在我的情况下,我需要为我想要提供给 web 配置的每个文件扩展名添加 MIME 类型:

<system.webServer>
    <staticContent>
      <mimeMap fileExtension=".shp" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".dbf" mimeType="application/octet-stream" />
      <mimeMap fileExtension=".kml" mimeType="text/xml" />
    </staticContent>
    ...
</system.webServer>

In case this helps anyone, I was getting this error when attempting to run aspnet_regiis.exe:如果这对任何人有帮助,我在尝试运行 aspnet_regiis.exe 时遇到此错误:

Operation failed with 0x8007000B操作失败,0x8007000B

An attempt was made to load a program with an incorrect format试图加载格式不正确的程序

As it turns out, the server was running 2008 64 bit and I was trying to run the 32 bit version of the utility.事实证明,服务器运行的是 2008 64 位,而我试图运行该实用程序的 32 位版本。 Running the version found in \\Windows\\Microsoft.NET\\Framework64\\v2.0.50727 fixed the issue.运行在 \\Windows\\Microsoft.NET\\Framework64\\v2.0.50727 中找到的版本修复了该问题。

c:\Windows\Microsoft.NET\Framework64\v2.0.50727>aspnet_regiis.exe -i

I've just had the same situation with my customer.我刚刚和我的客户遇到了同样的情况。 We have our own product which installs a web site.我们有自己的产品,可以安装网站。 The installer configures everything: the IIS pool, the site, web.config, etc.安装程序会配置一切:IIS 池、站点、web.config 等。

We installed another web site using our installer.我们使用我们的安装程序安装了另一个网站。 We entered the same parameters, so web.configs happened to be the same in both sites.我们输入了相同的参数,因此 web.configs 恰好在两个站点中相同。

However, the newly installed site worked fine, while the old one didn't.但是,新安装的站点运行良好,而旧站点则不行。 Then I opened 2 IIS Manager windows and started comparing the difference in web site settings.然后我打开了 2 个 IIS 管理器窗口并开始比较网站设置的差异。 And I found a problem.我发现了一个问题。

Somebody deleted all the Handler Mappings with the old site.有人删除了旧站点的所有处理程序映射。 If you go to "Handler mappings", you should see there aspx, asmx and other extensions and names of the handlers.如果您转到“处理程序映射”,您应该会看到 aspx、asmx 和其他扩展名以及处理程序的名称。 So, in the old site all those records were missing.因此,在旧站点中,所有这些记录都丢失了。

So, I would suggest first to check the "Handler mappings" - there must be a lot of records there.所以,我建议首先检查“处理程序映射”——那里肯定有很多记录。 Create a new web site and compare to know how many should there be.创建一个新网站并进行比较以了解应该有多少。

Who deleted them, a person or another program, I have no idea.谁删除了它们,一个人或另一个程序,我不知道。 If somebody can tell if there exists some tracking application which would tell that user domain\\john was modifying web site at date "07.03.2012 12:34" that would be useful.如果有人可以判断是否存在一些跟踪应用程序,它会告诉用户域\\约翰在日期“07.03.2012 12:34”修改网站,这将是有用的。

I fixed my issue on Windows 2012 server by Installing ALL WCF Features.我通过安装所有 WCF 功能修复了 Windows 2012 服务器上的问题。

A) Server Manager > Manage[link top left] > Add Roles and Features A) 服务器管理器 > 管理 [链接左上角] > 添加角色和功能

B) In Features > .Net Framework 4.5 Features > WCF Services B) 在功能 > .Net Framework 4.5 功能 > WCF 服务中

C) Check (enable) the features. C) 检查(启用)功能。 I checked all.我检查了所有。

D) Install D) 安装

Running Windows Server 2008 R2 64bit and .net framework 4.5, ran this command from this location, and was successful:运行 Windows Server 2008 R2 64 位和 .net framework 4.5,从此位置运行此命令,并成功:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -i

output:输出:

Microsoft (R) ASP.NET RegIIS version 4.0.30319.0
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation.  All rights reserved.
Start installing ASP.NET (4.0.30319.0).
.....
Finished installing ASP.NET (4.0.30319.0).

As @Mahmoodvcs mentioned i was require to set/add MIME types for the file extension that I needed to host/download directly, in this case is a Heroku's dump file (postgres's database backup), so in order to set a public IIS server where you can download this files without requiring AWS S3 bucket or HTTP shares like dropbox this is a terrific option!正如@Mahmoodvcs 提到的,我需要为我需要直接托管/下载的文件扩展名设置/添加 MIME 类型,在这种情况下是 Heroku 的转储文件(postgres 的数据库备份),因此为了设置公共 IIS 服务器,您可以下载此文件而无需 AWS S3 存储桶或像 dropbox 这样的 HTTP 共享,这是一个了不起的选择!

<staticContent>
  <mimeMap fileExtension=".dump" mimeType="application/octet-stream" />
</staticContent>

我也有这个错误,在 Windows Server 2008 IIS 7 上,我没有安装 Visual Studio,所以重新安装/修复 .NET 4.0 就成功了。

To add an extension to serve in IIS follow -要添加扩展以在 IIS 中提供服务,请执行以下操作 -

  1. Open IIS Manager and navigate to the level you want to manage.打开 IIS 管理器并导航到要管理的级别。
  2. In Features View, double-click MIME Types.在功能视图中,双击 MIME 类型。
  3. In the Actions pane, click Add.在操作窗格中,单击添加。
  4. In the Add MIME Type dialog box, type a file name extension in the File name extension text box.在“添加 MIME 类型”对话框中,在“文件扩展名”文本框中键入文件扩展名。 ... Type a MIME type ...输入 MIME 类型
  5. in the MIME type text box.在 MIME 类型文本框中。
  6. Click OK.单击确定。

For Windows Server 2016对于Windows Server 2016

  1. Open Server Manager form打开Server Manager表单
  2. Manage -> Add Roles and Features Manage -> Add Roles and Features
  3. Next until Features page接下来直到Features页面
  4. Check WCF Services feature with all subfeatures使用所有子功能检查WCF Services功能
  5. Next and Install NextInstall

By the way, I've just found out this post: http://blogs.msdn.com/b/webtopics/archive/2010/03/19/iis-7-5-how-to-enable-iis-configuration-auditing.aspx it explains how to audit changes on IIS.顺便说一句,我刚刚发现了这篇文章: http : //blogs.msdn.com/b/webtopics/archive/2010/03/19/iis-7-5-how-to-enable-iis-configuration -auditing.aspx它解释了如何审核 IIS 上的更改。 For those who face similar problems I suggest to turn on auditing and later see why your site stopped working.对于那些面临类似问题的人,我建议打开审核,然后查看您的站点停止工作的原因。

Related to Server 2016, I should add:与 Server 2016 相关,我应该补充:

  1. Run this command: aspnet_regiis -lv from this dir: C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\ This gives you the best view of what is going on运行此命令: aspnet_regiis -lv来自以下目录: C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\这使您可以最好地了解正在发生的事情

  2. On Server 2016, installing .net and iis out of sequence does not seem to be a problem.在Server 2016上,乱序安装.net和iis似乎不是问题。

  3. What is more likely to be a problem on Server 2016 is simply that asp.net is not installed on the machine. Server 2016 上更可能出现的问题只是机器上没有安装 asp.net。

If you are trying to view an extensionless file what worked for me was adding a MIME Type : File name extension : .如果您尝试查看无扩展名的文件,对我MIME Type是添加MIME Type文件扩展名. MIME type : text/plain MIME 类型text/plain

This might have some MVC implications, especially if your Static File Handler is above the Extensionless... handlers (under IIS / Handler Mappings ) but might be a work around when you only need this temporarily, like activating SSL Certs.这可能会对 MVC 产生一些影响,特别是如果您的Static File Handler程序高于Extensionless...处理程序(在IIS / Handler Mappings ),但当您只需要临时使用它时,例如激活 SSL 证书,这可能是一种解决方法。

Verify that the application pool in IIS (in the case of IIS7 or above) is selected as integrated.验证 IIS 中的应用程序池(在 IIS7 或更高版本的情况下)是否选择为集成。 In this case, probably change to Classic can solve this problem.在这种情况下,可能改用 Classic 可以解决这个问题。

I was trying to set up MediaWiki on my windows 7 pc and got this error.我试图在我的 Windows 7 电脑上设置MediaWiki并出现此错误。

My solution was to"create a global FastCGI handler mapping for php" .我的解决方案是“为 php 创建一个全局 FastCGI 处理程序映射”

PHP 7.3 Application IIS on Windows Server 2012 R2 Windows Server 2012 R2 上的 PHP 7.3 应用程序 IIS

This was a two step process for me.这对我来说是一个两步过程。

1) Enable the WCF Services - with a server restart 1) 启用 WCF 服务 - 重启服务器

2) Add a FASTCGI Module Mapping 2) 添加一个 FASTCGI 模块映射

1) 1)

Go to Server Manager > Add roles and features Select your server from the server pool Go to Features > WCF Services I selected all categories then installed转到服务器管理器 > 添加角色和功能从服务器池中选择您的服务器转到功能 > WCF 服务我选择了所有类别然后安装

2) 2)

Go to IIS > selected the site In center pane select Handler Mappings Right hand pane select Add Module Mappings转到 IIS > 选择站点在中心窗格中选择处理程序映射右侧窗格选择添加模块映射

Within the edit window:在编辑窗口中:

Request path: *.php请求路径:*.php

Module: FastCgimodule模块:FastCgimodule

Executable: I browsed to the php-cgi.exe inside my PHP folder可执行文件:我浏览到我的 PHP 文件夹中的 php-cgi.exe

Name: PHP7.3名称:PHP7.3

Now that I think about it.现在想想。 There might be a way to add this handler mapping inside the web-config so if you migrate your site to another server you don't have to add this mapping over and over.可能有一种方法可以在 web-config 中添加此处理程序映射,因此如果您将站点迁移到另一台服务器,则不必一遍又一遍地添加此映射。

EDIT: Here it is.编辑:在这里。 Add this to the section of the web-config.将此添加到 web-config 的部分。

<add name="PHP-FastCGI" verb="*" 
  path="*.php" 
  modules="FastCgiModule"
  scriptProcessor="c:\php\php-cgi.exe" 
  resourceType="Either" />

Set video to your IIS MIME Typevideo设置为您的IIS MIME Type

This solved my problems.这解决了我的问题。

Ref: https://stackoverflow.com/a/8853443/8832133参考: https : //stackoverflow.com/a/8853443/8832133

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 由于扩展配置,您请求的页面无法提供。 如果页面是脚本,则添加处理程序 - The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler 由于扩展程序配置,无法提供您请求的页面 - The page you are requesting cannot be served because of the extension configuration 无法为页面提供HTTP错误404.3-找不到 - Page cannot be served HTTP Error 404.3 - Not Found 错误消息 401.2:未经授权:由于服务器配置导致登录失败。 部署应用程序时 - Error message 401.2.: Unauthorized: Logon failed due to server configuration. When application deployed HTTP 错误 500.19 - 内部服务器错误无法访问请求的页面,因为该页面的相关配置数据无效 - HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid IIS 500.19 with 0x80070005 请求的页面无法访问,因为该页面的相关配置数据无效错误 - IIS 500.19 with 0x80070005 The requested page cannot be accessed because the related configuration data for the page is invalid error 如何在IIS错误500上更改消息“由于发生内部服务器错误而无法显示该页面。”消息? - How to change the message “The page cannot be displayed because an internal server error has occurred.” on IIS error 500"? 请求的页面无法访问,因为该页面的相关配置数据无效 - The requested page cannot be accessed because the related configuration data for the page is invalid 处理此类型的页面未提供错误 - Handle This type of page is not served error 无法显示页面,因为服务器发生内部服务器错误 - The page cannot be displayed because an internal server error has occurred on server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM