c# - 指定的参数超出了有效值的范围。参数名称 : site

标签 c# visual-studio iis web-config

我遇到了这样的错误:

Specified argument was out of the range of valid values.Parameter name: site

在调试我的任何项目时。

我在重新安装我的 Visual Studio 2012 后也尝试过。但是我在调​​试时又遇到了同样的问题。

我的系统配置是:

  • Windows 8:32 位
  • Visual Studio :2012

点赞网页时抛出异常,

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: site]
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +298

[HttpException (0x80004005): Specified argument was out of the range of valid values.
Parameter name: site]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

最佳答案

如果使用 IIS:

  • 控制面板
  • 程序
  • 打开或关闭窗口功能
  • 勾选互联网信息服务
  • 然后重启你的visual studio

如果使用 IIS Express:

从旧控制面板打开“添加/删除程序”并在 IIS Express 上运行修复 或者您可以转到控制面板 -> 程序 -> 程序和功能 -> 打开或关闭 Windows 功能 ->> 互联网信息服务 并勾选如下图所示的复选框:

enter image description here

关于c# - 指定的参数超出了有效值的范围。参数名称 : site,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17772216/

相关文章:

asp.net - Web 部署安装程序 (MSI) 中没有 'IIS 7 Deployment Handler'

c# - Jquery 下拉列表值返回未定义

javascript - VS JavaScript IntelliSense 没有按预期工作

asp.net - default.aspx 中的 "StartTag: invalid element name"

visual-studio - 使用 Visual Studio Code 远程启动 Singularity 容器

c# - 签署 ILMerge 的 DLL

sql-server - 什么会导致同一物理服务器上的两个 VM 之间出现延迟?

c# - 从 WCF 服务服务器引发事件

c# - 使用 System.Data.SQLite 打开 conn 时出错,尝试加载格式不正确的程序。互操作.084

c# - 与 nim 互操作返回包含 string/char* 成员的结构数组