我在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交叉发布.