加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

.net – Windows更新后WCF服务中的ServiceActivationException:

发布时间:2020-12-14 05:41:30 所属栏目:Windows 来源:网络整理
导读:我在IIS中安装了一个.NET 3.5 Web应用程序,它提供了几个WCF服务.这已在数十家公司部署超过一年,但最近一台服务器在调用服务或导航到IE中的.svc文件时遇到此错误: System.ServiceModel.ServiceActivationException: The service '/MyService/MySyncService.s
我在IIS中安装了一个.NET 3.5 Web应用程序,它提供了几个WCF服务.这已在数十家公司部署超过一年,但最近一台服务器在调用服务或导航到IE中的.svc文件时遇到此错误:

System.ServiceModel.ServiceActivationException: The service '/MyService/MySyncService.svc' cannot be activated due to an exception during compilation. The exception message is: Could not load file or assembly 'App_global.asax.vtxl8efb,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_global.asax.vtxl8efb,PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'App_global.asax.vtxl8efb,PublicKeyToken=null'
at System.Reflection.Assembly._nLoad(AssemblyName fileName,String codeBase,Evidence assemblySecurity,Assembly locationHint,StackCrawlMark& stackMark,Boolean throwOnFileNotFound,Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName,Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString,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)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath)

服务器在周末应用了Windows更新,之后发生了此错误,服务无法正常工作.另一个.NET 3.5 Web应用程序,而不是WCF,在同一台服务器上工作正常.

I was able to resolve the problem by stopping the app pool,deleting
the files in C:WINDOWSMicrosoft.NETFrameworkv2.0.50727Temporary
ASP.NET Filesmyservice,and starting the app pool again.

但我真的很想知道为什么会发生这种情况以及我能采取哪些措施来防止这种情况发生.在我们应用Windows更新后,要求所有客户完成这些步骤似乎不合理.

我没有使用这些应用程序中的任何一个Web部署项目(对此类错误的唯一引用,我可以找到所有引用Web部署项目,如this).我的Web应用程序项目已构建,然后进行复制部署.

它看起来有点像MS的this problem,他们已经发布了补丁,但实际上并不相同.

在MSDN forums交叉发布.

解决方法

这是一个历史性的猜测,我认为你看到我在上一份工作中所看到的.

安装更新时安装更新或.net框架更新并且应用程序[site]仍在使用时会出现此问题.它无法清除所需的文件,并且它不会被视为将阴影复制的缓存标记为脏的事件,因此它不会重新编译.问题是现在无法访问dll,因为[这是我不是100%确定的地方]我认为dll上的入口点发生了变化,因此dll在系统中看起来不是正确的.由于它无法找到它认为正确的东西,它会引发上述异常.如果您让系统通过触摸文件[dll或config]将应用标记为已更改,则应该足以使其重新编译卷影副本.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读