C# WCF服务经常关闭,需要重置应用程序池才能启动

C# WCF服务经常关闭,需要重置应用程序池才能启动,c#,wcf,iis,C#,Wcf,Iis,我创建了一个在windows应用程序中使用的WCF服务。此服务在执行应用程序时工作完美。但若我在大约20分钟或更长的时间内并没有执行应用程序,然后在我执行应用程序之后,当我点击浏览器上的服务url时,服务就会关闭并显示以下错误。应用程序池重置服务启动后,我不想频繁重置应用程序池。如果有人能帮我解决这个问题,那将是很大的帮助 Server Error in '/ConnectionService' Application. Unhandled Execution Error Descrip

我创建了一个在windows应用程序中使用的WCF服务。此服务在执行应用程序时工作完美。但若我在大约20分钟或更长的时间内并没有执行应用程序,然后在我执行应用程序之后,当我点击浏览器上的服务url时,服务就会关闭并显示以下错误。应用程序池重置服务启动后,我不想频繁重置应用程序池。如果有人能帮我解决这个问题,那将是很大的帮助

Server Error in '/ConnectionService' Application.

Unhandled Execution Error 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
例外情况详情:

 Exception Details: System.IO.FileLoadException: 
源错误:

 An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
堆栈跟踪:

[FileLoadException]
   System.ServiceModel.Activation.ServiceHttpModule.BeginProcessRequest(Object sender, EventArgs e, AsyncCallback cb, Object extraData) +0
   System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +12685826
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288
版本信息:

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18446 

您是否能够查看服务器日志中的内容,或者在服务器关闭时通过浏览器浏览到该服务?这将给出实际的例外情况;由于明显的原因,生产设置不会公布错误的具体细节。IIS日志显示错误如下:字段:日期时间s-ip cs方法cs uri stem cs uri查询s-port cs用户名c-ip csUser代理sc状态sc子状态sc-win32状态所用时间2014-07-24 16:30:31 192.168.225.227 POST/ConnectionService/Arbor.CareOrganization.ConnectionService.Service.svc-80-192.168.111.110-401 2 5 0当服务在浏览器上运行时,它显示错误,如我在原始线程中所述。不确定是什么导致了这个问题。好吧……好吧,每次都会发生FileLoadException,除非服务正在使用.dll执行某些操作,我怀疑不是这样。它工作然后停止这一事实表明,某些资源被锁定而没有释放——所有实现IDisposable的东西都可以在using语句中使用,还是以其他方式处理掉了?是的,所有资源都得到了处理,以便释放。NTLM身份验证似乎出了问题,因为该服务在匿名身份验证的所有场景中都能完美工作。