简体   繁体   English

间歇性WCF激活错误

[英]Intermittent WCF activation errors

I'm running a WCF service locally on my dev box, and my tests check all is well with the service. 我在我的开发箱上本地运行WCF服务,我的测试检查所有服务都很好。

Usually, all is fine, but sometimes (5% of the time), I get the error 通常,一切都很好,但有时(5%的时间),我得到错误

The requested service, 'net.tcp://csmattdev2:9000/Wcf/Service.svc' could not be activated. See the server's diagnostic trace logs for more information.

The info in the event log looks like: 事件日志中的信息如下所示:

WebHost failed to process a request.
 Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/11404313
 Exception: System.ServiceModel.ServiceActivationException: The service '/Wcf/Service.svc' cannot be activated due to an exception during compilation.  The exception message is: Could not load file or assembly 'App_Web_okepeg2c, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.. ---> System.IO.FileNotFoundException: Could not load file or assembly 'App_Web_okepeg2c, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   --- End of inner exception stack trace ---
   at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
   at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity)
 Process Name: w3wp
 Process ID: 14844

To fix, the only thing that works is to reset IIS, and rebuild the comms project. 要修复,唯一有效的方法是重置IIS,并重建comms项目。

Any ideas what this could be? 任何想法可能是什么?

Try removing everything from the web root except for the following things. 尝试从Web根目录中删除所有内容,但以下内容除外。

1) the .svc you are using to expose the endpoint 1)用于公开端点的.svc
2) the .config file 2).config文件
3) the bin files that contain your service code 3)包含您的服务代码的bin文件

Bascially, remove all the web application stuff from the web root 基本上,从Web根目录中删除所有Web应用程序内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM