我遇到了这样的错误:
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 功能 ->> 互联网信息服务 并勾选如下图所示的复选框:
关于c# - 指定的参数超出了有效值的范围。参数名称 : site,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17772216/