.net – Windows更新后WCF服务中的ServiceActivationException:无法加载文件或程序集’App_global.asax.vtxl8efb,Version = 0.0.0.0

前端之家收集整理的这篇文章主要介绍了.net – Windows更新后WCF服务中的ServiceActivationException:无法加载文件或程序集’App_global.asax.vtxl8efb,Version = 0.0.0.0前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在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:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary
ASP.NET Files\myservice,and starting the app pool again.

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

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

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

MSDN forums交叉发布.

解决方法

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

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

猜你在找的Windows相关文章