当前位置: 代码迷 >> Web Service >> 问一个有关WCF的不定期异常
  详细解决方案

问一个有关WCF的不定期异常

热度:357   发布时间:2012-12-22 12:05:07.0
问一个有关WCF的不定期错误。
最近写了个一个sl的程序在后台调用了WCF的服务,本地测试,远程部署都完全没问题。但是运行一段时间后WCF会出现如下错误


“/”应用程序中的服务器错误。
--------------------------------------------

未能加载文件或程序集“App_Web_-akibknx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。系统找不到指定的文件。 
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 

异常详细信息: System.IO.FileNotFoundException: 未能加载文件或程序集“App_Web_-akibknx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。系统找不到指定的文件。

源错误: 

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  

程序集加载跟踪: 下列信息有助于确定程序集“App_Web_-akibknx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null”无法加载的原因。


警告: 程序集绑定日志记录被关闭。
要启用程序集绑定失败日志记录,请将注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD)设置为 1。
注意: 会有一些与程序集绑定失败日志记录关联的性能损失。
要关闭此功能,请移除注册表值 [HKLM\Software\Microsoft\Fusion!EnableLog]。

 

堆栈跟踪: 


[FileNotFoundException: 未能加载文件或程序集“App_Web_-akibknx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。系统找不到指定的文件。]
   System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
   System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
   System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
   System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
   System.Reflection.Assembly.Load(String assemblyString) +28
   System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +162
   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +11656092
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

[ServiceActivationException: 由于编译过程中出现异常,无法激活服务“/wishstar.svc”。异常消息为: 未能加载文件或程序集“App_Web_-akibknx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null”或它的某一个依赖项。系统找不到指定的文件。。]
   System.ServiceModel.AsyncResult.End(IAsyncResult result) +11527290
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
   System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


感觉是动态生成DLL消失了,这个DLL本身并不存在于编译后的项目中。应该是WCF部署好以后自动生成的。但现在每次都要重新copy一次WCF程序,才能正常显示,过一段时间又出现上面这个故障。不知道有没有人遇到过,请大家帮下忙啊。 
  相关解决方案