.net - Windows 更新后 WCF 服务中的 ServiceActivationException : Could not load file or assembly 'App_global. asax.vtxl8efb,版本 = 0.0.0.0

标签 .net wcf iis

我在 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, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'App_global.asax.vtxl8efb, Version=0.0.0.0, Culture=neutral, 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, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.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)
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 应用程序项目已构建,然后复制部署。

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

交叉发表于 MSDN forums .

最佳答案

这更像是一种历史猜测,我认为您正在看到我在上一份工作中看到的内容。

当您安装安全更新或 .net 框架更新并且在安装更新时应用程序 [站点] 仍在使用中时,会出现此问题。它不能清除所需的文件,也不能算作将影子复制缓存标记为脏的事件,因此它不会重新编译。问题是现在无法访问 dll,因为 [这是我不能 100% 确定的地方] 我认为 dll 上的入口点已更改,因此 dll 对系统而言似乎不是正确的.由于找不到它认为正确的内容,因此会引发上述异常。如果您让系统通过触摸文件 [dll 或 config] 将您的应用程序标记为已更改,则应该足以使其重新编译卷影副本。

关于.net - Windows 更新后 WCF 服务中的 ServiceActivationException : Could not load file or assembly 'App_global. asax.vtxl8efb,版本 = 0.0.0.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12579862/

相关文章:

c# - 为什么 Main 方法是私有(private)的?

wcf - DataContract 和 DataMember 属性 - 它们如何影响类型

.net - 如何从 WCF 服务返回用户定义的类型?

c# - Entity Framework 中的映射?

C#6.0 字符串插值本地化

c# - C#(甚至 CLR)中有多少内置值类型

asp.net - 如何在IIS 7中将应用程序添加到“默认网站”?

c# - 为手动生成的 WCF(客户端)代理实现异步/等待模式

c# - 如何在 IIS 中托管 WCF 应用程序?

c# - 使用 ServerManager.OpenRemote 远程连接到 IIS7