【问题标题】:Windows service is not getting started after adding the “gcServer” config setting in the app.config在 app.config 中添加“gcServer”配置设置后,Windows 服务未启动
【发布时间】:2011-08-03 17:40:04
【问题描述】:

当我们在生产服务器上为我的 Windows 服务应用程序获取 OutOfMemory 异常时。我们正在尝试在服务 app.config 中添加“gcServer”设置。这里的问题是,添加此配置设置后,我们无法启动服务。

配置设置

<Configuration>
  <runtime>
    <gcServer enabled="true" />
  </runtime>
</Configuration>

以下所有链接都建议对非交互式 Microsoft .NET Windows 服务器应用程序进行此更改:

http://support.microsoft.com/default.aspx?scid=kb;en-us;840523
http://msdn.microsoft.com/en-us/library/ff647790.aspx
http://blogs.msdn.com/b/junfeng/archive/2004/07/13/181534.aspx
http://stackoverflow.com/questions/794415/experience-using-gcserver-true-to-set-garbage-collector-for-net

以下是记录到事件查看器的错误。谁能帮我们解决这个问题。

应用程序错误

Faulting application name: Myapp.exe, version: 1.0.0.0, time stamp: 0x4e395587
Faulting module name: KERNELBASE.dll, version: 6.1.7601.17514, time stamp: 0x4ce7c78c
Exception code: 0xe0434352
Fault offset: 0x000000000000a49d
Faulting process id: 0xd90
Faulting application start time: 0x01cc51e6907b6880
Faulting application path: D:\Users\xxx\Projects\Myapp\bin\Debug\Myapp.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: ce3178ef-bdd9-11e0-8de9-7071bcbcc063

.NET 运行时

Application: Myapp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Configuration.ConfigurationErrorsException
Stack:
   at System.Configuration.ClientConfigurationSystem.EnsureInit(System.String)
   at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(System.String)
   at System.Configuration.ConfigurationManager.get_AppSettings()
   at Myapp..ctor()
   at Myapp.Program.Main()

【问题讨论】:

    标签: windows service


    【解决方案1】:

    将配置元素节点名称的大小写改为全部小写:

    <configuration>
      <runtime>
        <gcServer enabled="true" />
      </runtime>
    </configuration>
    

    【讨论】:

      猜你喜欢
      • 2012-12-06
      • 1970-01-01
      • 2014-10-24
      • 1970-01-01
      • 2013-04-17
      • 2021-05-16
      • 1970-01-01
      • 2021-09-27
      • 1970-01-01
      相关资源
      最近更新 更多