Reputation: 41897
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.
Upvotes: 4
Views: 1261
Reputation: 391
This is more a historical guess that I think you're seeing what I saw at my last job.
The issue occurs when you install a security update or .net framework update and the application[site] is still in use while the update is installed. It can't purge out the needed files and it doesn't count as an event that would flag the shadow copied cache as dirty so it doesn't recompile. The problem is that the dlls now can't be accessed because [and this is where i'm not 100% certain] I think the entry points changed on the dlls so the dll doesn't appear to the system to be the right one. Since it couldn't find what it thought was the right one it throws the above exception. If you get the system to flag your app as changed by touching a file [dll or config] it should be enough to cause it to recompile the shadow copy.
Upvotes: 1