gpt4 book ai didi

c# - 间歇性 WCF 激活错误

转载 作者:行者123 更新时间:2023-11-30 18:39:25 29 4
gpt4 key购买 nike

我在我的开发箱上本地运行 WCF 服务,我的测试检查该服务一切正常。

通常,一切都很好,但有时(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.

事件日志中的信息如下所示:

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

要修复,唯一可行的方法是重置 IIS,并重建通信项目。

知道这可能是什么吗?

最佳答案

尝试从网络根目录中删除除以下内容之外的所有内容。

1) 您用于公开端点的 .svc
2) .config 文件
3) 包含您的服务代码的bin文件

基本上,从 Web 根目录中删除所有 Web 应用程序内容

关于c# - 间歇性 WCF 激活错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9821373/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com