HTTP 错误 404.17 - 未找到 - .NET - IIS 10

Mig*_*toy 2 windows asp.net iis-10

这是我第一次在 ASP.NET 中发布 Web 表单项目。我遇到过可能的 http 错误,但我不明白这个错误。我的IIS版本是10.0

HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
Run Code Online (Sandbox Code Playgroud)

我在互联网上看到了很多解决方案,有一个共同点,并且正在运行

C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i in cmd.
Run Code Online (Sandbox Code Playgroud)

但我确实收到此错误:

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).
This option is not supported on this version of the operating system.  Administrators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows Features On/Off" dialog,  the Server Manager management tool, or the dism.exe command line tool.  For more details please see http://go.microsoft.com/fwlink/?LinkID=216771.
Finished installing ASP.NET (4.0.30319.0).
Run Code Online (Sandbox Code Playgroud)

我检查了我的 .Net 版本,.Net 上的版本是 3.5 和 4.8 Turn windows features on/off。我确实选择了 4.8,因为它会导致很多错误。还是我需要选择它?

如果我选择 .Net 4.8 版本,则会出现此错误。

Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Run Code Online (Sandbox Code Playgroud)

哪个容易解决?还是我需要同时解决这两个问题?

如果您有任何解决方案,请告诉我。

提前致谢

Mig*_*toy 5

解决了我的问题。

  1. 转到打开/关闭 Windows 功能
  2. 展开.NET Framework 4.8 高级
  3. 服务 扩展 WCF 服务
  4. 检查 HTTP 激活

刷新网站,应该可以了!