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

后端 未结 3 1260
南方客
南方客 2021-01-15 03:43

I have recently begun working with AJAX-Enabled WCF, and have been plagued with this .NET caching issue - Could not load file or assembly App__Web__hamznvwf

相关标签:
3条回答
  • 2021-01-15 04:09

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

    0 讨论(0)
  • 2021-01-15 04:15

    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.)
    0 讨论(0)
  • 2021-01-15 04:16

    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.

    0 讨论(0)
提交回复
热议问题