4

How did you get rid of these annoying ASP.NET errors: Could not load file or assembly 'App_Web_z9w33txs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

This has only happened to me once before. It seems like it is related to ASP.NET caching some assembly dynamically, but not recompiling it for some reason. Thoughts? How do you fix this? What causes it?

More Info: This is happening to a WCF Service being called via Ajax from my Default.aspx page. The Default.aspx page loads fine.

removed stack trace

Final Update:
So this is happening to me at least 5 times a day now. I have to shutdown the app pool.
Go into C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files and deleted the files here Then restart the app pool. Anybody else run into something like this? Should I just break down and create a support case with Microsoft.

BuddyJoe
  • 69,735
  • 114
  • 291
  • 466
  • Even more info: restarting IIS had no effect. What the heck. The WCF-via-AJAX calls had been working fine, then all of sudden this just started. – BuddyJoe Dec 30 '08 at 19:28
  • restart your browser and clear your cache...maybe your browser is caching a AJAX resource – craigmoliver Dec 30 '08 at 19:34
  • Does connecting to a server via FTP cause this to happen more often? Just happened to me again today. – BuddyJoe Dec 31 '08 at 21:14
  • I also get this with asp.net 4.0, although I am using the development web server at the moment. Creating a new project in a different folder fixes it for now! Can't find an answer to this anywhere. – Peter C Oct 04 '10 at 13:23
  • This used to happen on my dev machine, and a rebuild fixed it, but now it's deployed to the staging server it happens all the time. I can fix it by forcing a recompile (e.g.: saving a space character into a code file in app_code) but doing this 5 times a day to keep a production WCF service running won't be feasible. – MGOwen May 06 '11 at 06:12

5 Answers5

4

Close your solution, shutdown IIS, go to:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\

And delete all of those files. Then restart IIS and try it all again.

Developer
  • 8,390
  • 41
  • 129
  • 238
BobbyShaftoe
  • 28,337
  • 7
  • 52
  • 74
2

I have got that error. I Choose "Clean Solution" and then "Rebuild Solution". Once my rebuild succeeds the error goes away. I dont think it is just a WCF thingy.

  • I'm connected live to a site (via FTP). I don't see a "Clean Solution". I do when I work on local projects though. – BuddyJoe Dec 30 '08 at 19:35
2

If you are getting this error after compiling and/or publishing changes your apps, try the compile option "Use fixed naming and single page assemblies".

Sometimes I get that when I upload a change to a server and the app hasn't recompiled yet. Those may be temp files, try restarting the IIS Admin service (if you can) to see if it goes away.

craigmoliver
  • 6,499
  • 12
  • 49
  • 90
  • restarting IIS had no effect. Does ASP.NET "runtime" try to package up the WCF stuff separately ... I wonder why other parts of the app are working. – BuddyJoe Dec 30 '08 at 19:43
2

Try closing Visual Studio and then deleting all the folders in your Temporary ASP.NET Files folder by running the following from the Command Prompt:

rd "%TEMP%\Temporary ASP.NET Files\." /s /q

or from PowerShell:

gci "$env:TEMP\Temporary ASP.NET Files" | % {ri $_.FullName -recurse}

Depending on which Frameworks are used, also clear the following folders on the web server:

%windir%\Microsoft.NET\v1.1.4322\Temporary ASP.NET Files\
%windir%\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
Gordon Bell
  • 13,337
  • 3
  • 45
  • 64
  • 1
    Those commands are to cleanup your local development PC. Clear the "Temporary ASP.NET Files" folders in your "Windows\Microsoft.NET\Framework" on the web server. – Gordon Bell Dec 30 '08 at 20:14
2

Sometime I have got such error and began to research how to resolve it. Just deleting ASP.NET temporary directory didn't any influence in my case. Then I just have added such attribute to web.config compilation node:

<compilation debug="true" tempDirectory="c:\temp" >

I hope that this can help and other people.

apros
  • 2,848
  • 3
  • 27
  • 31