【发布时间】:2020-05-14 12:31:25
【问题描述】:
这是我第一次在 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.
我在互联网上看到了很多解决方案,其中有一个共同点,并且正在运行
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i in cmd.
但我确实收到此错误:
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).
我检查了我的 .Net 版本,在 Turn windows features on/off 上它是 3.5 和 4.8。我确实选择了 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'.
哪个容易解决?还是我需要同时解决这两个问题?
如果您有任何解决方案,请告诉我。
提前致谢
【问题讨论】:
-
我检查了我的 .Net 版本,在打开/关闭 Windows 功能时它是 3.5 和 4.8。我确实选择了 4.8,因为如果会导致很多错误。还是我需要选择它?请澄清一下?选择还是取消选择?
-
我选择了它现在我收到了
Server Error in '/' Application. Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. -
我已经看过这个并且已经尝试过了,但是一点运气都没有。
-
404.17 还意味着动态 URL 已映射到静态文件处理程序。当您没有安装正确的处理程序时,它总是会发生。因此,如果您遇到此问题,您可以检查您正在加载的内容并尝试安装正确的处理程序。很高兴你解决了这个问题。