我正在 Windows Server 2003(vps 托管)上使用 II6 构建一个 ASP.NET 应用程序。 我遇到了在我的开发机器(Windows 7、iis 7.5、64 位)上未收到的错误。
当我的 wcf 服务尝试启动针对本地 SQL 服务器运行的查询时,这是我收到的错误:
Memory gates checking failed because the free memory (43732992 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.
和想法?
最佳答案
在你的web.config中,在你的configuration\system.serviceModel\serviceHostingEnvironment元素中,添加一个minFreeMemoryPercentageToActivateService属性,并将其设置为低于5的值,我将我的设置为0,这个错误就消失了。
例如:
<configuration>
<system.serviceModel>
<serviceHostingEnvironment ... minFreeMemoryPercentageToActivateService="0" />
</system.serviceModel>
</configuration>
警告来自MSDN :“指定此属性以及对 WCF 服务的 web.config 文件的部分信任将导致服务运行时出现 SecurityException。”
关于asp.net - 使用wcf对sql server运行查询时出现奇怪的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2880383/