I have a .NET 3.5 web app installed in IIS that provides several WCF services. This has been deployed at tens of firms for over a year, but one one server recently they encountered this error when calling the service or navigating to the .svc file in IE:
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)
The server had had windows updates applied over the weekend and afterwards this error was occurring and the service was not working. Another .NET 3.5 web app, not WCF, on the same server was working fine.
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.
But I'd really like to know why this would happen and what I can do to prevent it. It doesn't seem reasonable for me to ask all my clients to go through these steps after they've applied windows updates.
I don't use a web deployment project with either of these apps (the only references to an error like this that I can find all refer to web deployment projects, like this). My web application project is built and then copy-deployed.
It looks a little like this problem from MS which they've released a patch for, but not actually the same.
Cross-posted in MSDN forums.