ASP.NET: WCF and Could not load file or assembly 'App_Web_hamznvwf

十年热恋 提交于 2019-12-01 10:43:22

Wow, this one is a bit of a doozy. I did some research and apparently lots of people have been experiencing this problem for years. It's possible that you are caching types that are defined in your web site. Such types do not have an assembly, so one is randomly generated for them at runtime. The next time you recycle your web server, your types are given a different randomly generated assembly, and your cache won't be able to deserialize because the old assembly no longer exists. Here are some possible fixes you can try:

  • Define all types in a separate assembly rather than in your web site.
  • On your local box, see if running the site in webdev rather than iis has the same behavior.
  • If you're using out-of-proc (SQL Server) session/cache storage, try using in-proc (local in-memory) session/cache storage
  • Delete all subdirectories under C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files (as Dimi mentioned, use Unlocker to break locks any applications might have)
  • If you precompile your web site when deploying, make sure your web server is shut down before deploying. (Apparently if users are requesting pages on the old version of the site, it will screw things up when the new version is deployed.)

Have you tried disabling the indexing service? Also, it might be worthwhile to move to a Web application project and see if this problem persists.

Additionally to what the previous poster said, I would suggest using a tool like this to determine where the problem lies.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!