asp.net - 使用wcf对sql server运行查询时出现奇怪的错误

标签 asp.net sql-server wcf

我正在 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/

相关文章:

asp.net - Dart 可以与 ASP.Net 一起工作吗?

asp.net - 无法让我的导航栏以网站 ASP.Net 为中心

c# - 如何从以编程方式生成的 SSIS 包中获取已处理的行数到调用应用程序?

asp.net - 当我们将 Load User Profile = True 设置为应用程序池标识时,实际加载的是哪个用户?

wcf - WCF 服务的 WebSetup

asp.net - 只执行最后调用的函数

c# - 将选定值的集合从 Select2-Multi DropDownList 传递到 Controller

sql-server - "Null"值在 SQL Server 中占用多少大小

c# - 在 RESTful WCF 服务中访问调用者的域名

c# - WCF 不添加服务