gpt4 book ai didi

c# - 无法让 IIS 显示 Web 应用程序

转载 作者:行者123 更新时间:2023-11-30 19:46:47 25 4
gpt4 key购买 nike

我在编译/调试我的网络应用程序时完全没有问题,但是当我尝试从我的 IIS 服务器运行它时,我收到了这个错误:

    Server Error in Application "DEFAULT WEB SITE"    Internet Information Services 7.5    Error Summary    HTTP Error 404.3 - Not Found    The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.    Detailed Error Information    Module  StaticFileModule    Notification    ExecuteRequestHandler    Handler StaticFile    Error Code  0x80070032    Requested URL   http://student-006:80/dataentry/lomform.aspx    Physical Path   C:\inetpub\wwwroot\dataentry\lomform.aspx    Logon Method    Anonymous    Logon User  Anonymous    Most likely causes:    It is possible that a handler mapping is missing. By default, the static file handler processes all content.    The feature you are trying to use may not be installed.    The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)    If ASP.NET is not installed.    Things you can try:    In system.webServer/handlers:    Ensure that the expected handler for the current page is mapped.    Pay extra attention to preconditions (for example, runtimeVersion, pipelineMode, bitness) and compare them to the settings for your application pool.    Pay extra attention to typographical errors in the expected handler line.    Please verify that the feature you are trying to use is installed.    Verify that the MIME map is enabled or add the MIME map for the Web site using the command-line tool appcmd.exe.    To set a MIME type, use the following syntax: %SystemRoot%\windows\system32\inetsrv\appcmd set config /section:staticContent /+[fileExtension='string',mimeType='string']    The variable fileExtension string is the file name extension and the variable mimeType string is the file type description.    For example, to add a MIME map for a file which has the extension ".xyz": appcmd set config /section:staticContent /+[fileExtension='.xyz',mimeType='text/plain']    Warning: Ensure that this MIME mapping is needed for your Web server before adding it to the list. Configuration files such as .CONFIG or dynamic scripting pages such as .ASP or .ASPX, should not be downloaded directly and should always be processed through a handler. Other files such as database files or those used to store configuration, like .XML or .MDF, are sometimes used to store configuration information. Determine if clients can download these file types before enabling them.    Install ASP.NET.    Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.    Links and More Information    This error occurs when the file extension of the requested URL is for a MIME type that is not configured on the server. You can add a MIME type for the file extension for files that are not dynamic scripting pages, database, or configuration files. Process those file types using a handler. You should not allows direct downloads of dynamic scripting pages, database or configuration files.    View more information »

我做错了什么?我该如何纠正这个问题?我正在运行 Windows 7/iis 7

最佳答案

听起来像 asp.net 配置已经开始了。

重新运行 aspnet_regiis -i 看看会发生什么。这应该添加所有必要的设置并添加 .aspx 页面的处理程序。

要运行 aspnet_regiis -i 打开命令提示符(Windows + R,键入 cmd,回车)并切换到 C:\Windows\Microsoft.NET\Framework{FRAMEWORK VERSION} 目录,然后执行命令。

例如对于 64 位 Windows 上的 .net 4

> cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319

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

关于c# - 无法让 IIS 显示 Web 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7891607/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com