CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Brendan Tompkins [MVP]

Blog First. Ask Questions Later.

Fix for ASP.NET "Could not load file or assembly App_Web..." Error

Every so often on our production web servers, we get the "Could not load file or assembly App_Web..." error.  There's a long thread over at ASP.NET about this issue, but I thought a simple post may help others running into this problem.

I've found an quick and easy, albeit not ideal fix for this problem.  There's supposedly a hotfix for this, but there are reports that this won't actually fix the error.  Until a good long term fix comes around, here's a quick way to fix this problem. 

Delete all temporary ASP.NET files, by removing the folders under the following directory: 

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

Your mileage may vary (win directory differences, etc)

-Brendan 


Published Nov 15 2006, 10:06 AM by Brendan Tompkins
Filed under:

Comments

david said:

It didnt work for me.

# November 22, 2006 2:21 AM

Toby said:

nor me - this is one big problem it seems.  Have tried endless reconfiguration after upgrading to the latest ajax asp.net version, but it has completely broken my application...

# January 2, 2007 7:42 AM

Brendan Tompkins said:

Hmm.. Are you deleting everything from this directory successfully?

# January 2, 2007 8:05 AM

Madhu said:

thanks alot...it works.

I was hooked with this error for two days...

Good work..

cheers

madhu

# January 24, 2007 2:25 AM

Darpan said:

Delete the Line in which the assembly is loaded from web.config

It has worked for me nothing else was working for hours.

# March 16, 2007 9:12 AM

Grig Gheorghiu said:

Thanks, Brendan! I got paged at 5:30 AM by one of our ASP.NET sites, and Google + your blog post proved invaluable in getting things up and running again!

- stopped WWW Publishing service

- deleted temp files you specified

- started WWW Publishing service

Thanks again!

Grig

# May 2, 2007 8:10 AM

fff said:

not worket for me

# May 4, 2007 6:34 AM

Gavin said:

If we're talking about the same error, I've been getting this for years.  If you delete temporary files (or, as the asp.net forum mentions, make a small change to the user control indicated in the error), you force a recompile, and the error goes away.  The *error* goes away, but not the *problem.*

A real "fix" would prevent the problem from occuring -- which it does only sporadically.  I don't know how to reproduce this bug, nor of anyone else who does.  MS can't do anything about it, after all, until it's reproducible.

# May 29, 2007 1:38 PM

Sammael Cavalera said:

Para arreglar este error :

Una vez que se publique el Sitio Web, hay que ir al: Servicios de Internet Information Server (IIS), desplegar el menu de la parte izquierda, en este menu donde dice: Sitio Web Predeterminado crear un nuevo Directorio Virtual, se sigue los pasos , se pone un Alias (puede ser el mismo nombre con el que se publico nuestro Proyecto), luego donde sale escoger el directorio, escogemos nuestro sitio web que acabamos de publicar y poner siguiente, siguiente, las opciones que salen por defecto.

Luego ponemos en el URL del Internet Explorer la dirección de nuestro sitio y ya no saldra el error.

En mi caso (trabajando con: Microsoft Visual Studio 2005 y AJAX), con esto pude arreglar el problema de: Could not load file or assembly App_Web ...

# September 1, 2007 6:28 PM

jrush said:

I can't believe that MS hasn't provided a real solution for this problem yet. The solution listed here is only a temp solution, but I've only experienced this problem with sites using master pages & nested user controls. Is this the case for everyone else?

# September 7, 2007 10:46 AM

Dave said:

I've never gotten an error like this running classic ASP - it has 100% up time. Running SiteScope just to make sure. Should I just skip asp.net 2.0 and wait for a fix. I need to be up 100% of the time. Perhaps this is only related to the compile at runtime style deployment vs. the Asp.net 1.0 approach of precompiling everything.

# September 7, 2007 12:11 PM

D@ said:

We have an app being used by our university and this error suddenly shown up after moving to a new server. After months trying every possible solutions from the web... none working for us. Finally, last week the error disappeared completely after we undo the default pool recycling in our IIS .  Hope this would help someone with the same problem.

Cheers,

# September 18, 2007 2:34 AM

Rob said:

Just case other people come across this problem and they are using .net 2 to write their app, make sure your IIS setting isn't using 1.1 !!! (yes I know!)

# October 7, 2007 7:59 AM

Lata said:

Good!!

It's work for me..m getting this headache from half of the day...thanks...a lot :)

# October 11, 2007 2:40 AM

Lata said:

Its' work for me..........Thanks a lot!!!

# October 11, 2007 2:41 AM

ian blair said:

my error "could not load file or assembly comes up when i start the computer so is not a big problem but an annoyance, checked in the temporary ASP.net files and there was none to delete so fix did not work for me , thanks in advance.

# October 13, 2007 10:20 AM

Hanno said:

I copied over the new dll's to wherever they appear in the project, I've reregistered my references, I've deleted my temp files, and STILL, the old version is stuck somewhere. I can't figure out where. This is SO frustrating!

# November 12, 2007 12:41 PM

Prakash said:

Thank you very much for providing solution. It has resolve my similar issue.

# November 23, 2007 1:24 AM

Fakur said:

Thank you so much..

After a year this artikel. I got similiar problem, and it has been resolved.

# November 28, 2007 11:01 AM

Jay said:

A quicker fix would be to enable/disable the "Enable Debugging" checkbox in IIS under ASP.NET > Edit Configuration > Application

# December 4, 2007 2:40 PM

linxiang said:

Sometimes that we cann't do this action,because we have no acces to the web server.

# December 19, 2007 4:44 AM

Laura said:

What if i get the error but the folder mentioned above is empty?

How can i fix it in this case?

# December 29, 2007 12:43 PM

native said:

Thank you, it worked for me too.

# January 7, 2008 6:27 PM

Sean said:

Thanks, this seems to have fixed it for me...

# January 24, 2008 7:56 AM

Ahmad said:

ohhh..yes it solved my problem...helpful....i was hanged by this problem...

Thank you....

# February 1, 2008 9:33 AM

mark borg said:

Hi guys maybe it could help someone. I had the same problem and what fixed the problem is to :

(1) Remove the AJAX DLL from the references

(2) Add the same AJAX DLL again as a reference

(3) Rebuild the project

i cannot assure that it works, but i worked for me

good luck

# February 1, 2008 5:20 PM

Ron Kuper said:

It's 4:14 AM here in Israel and I LOVE YOU SO MUCH Brendan!!!!!!

I LOVE YOU I LOVE YOU I LOVE YOU I LOVE YOU!!!

# March 4, 2008 9:17 PM

Rajambal said:

Thanks a lot ... sir.. It solved my problem.

# May 6, 2008 6:00 AM

prabhaharan said:

thanks a lot. its working...

# May 7, 2008 1:06 AM

Jacek Ciereszko said:

Thanks, You helped me :)

I work with Silverlight and WCF Services and I have often this stupid error :/

# May 15, 2008 3:22 PM

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# May 15, 2008 3:23 PM

Matthew said:

Here's how I created and then fixed this problem. I hope it helps someone.

I changed the name of a file.

Then I went in and manually changed the top statement in the aspx (I use separate c# code files)  to reflect the proper: 1) 'inherits' statement and the 'codefile' variable.

I neglected to change the class name in the .cs file.

That was what CREATED the error.

To fix it? I renamed the class name in the .cs file to correspond with my other renamings and... voila. No more app_web errors.

Is this helpful?

# May 22, 2008 9:54 AM

Gopi said:

Verify the Project property

project property --> build-->platform target

# June 12, 2008 7:42 AM

birju said:

thanks

# June 16, 2008 12:25 AM

Marco said:

To resolve the problem, I also took care to use the correct version of the .NET framework:

1. Go to Internet Information Services

2. Go to the virtual directory, right click on it and go to Properties

3. Go to ASP.NET tab, and choose 2.0.50727 in ASP.NET version

Hope this helps

# June 22, 2008 1:56 PM

Komputerowe » Blog Archive » Problemy i cz??ste b????dy podczas pracy z Silverlight-em . Part 1 said:

Pingback from  Komputerowe  » Blog Archive   » Problemy i cz??ste b????dy podczas pracy z Silverlight-em . Part 1

# June 26, 2008 3:47 AM

Aysha said:

thanx a dozenn ...........it worked by deleting files from TempASP.Net files!!

:D

# June 28, 2008 6:41 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Brendan Tompkins

Brendan has been programming with .NET since the first public beta and is owner and operator of Port Technology Services, a consultancy company providing .NET application development services to the Maritime industry. In July, 2007, he was awarded the Microsoft MVP award for ASP.NET. He's also a proud co-founder of failed .COM startup Intrinsigo, and has had a hand in the failure of numerous other businesses. He currently runs CodeBetter.Com and Devlicio.us, and lives in Norfolk, Virgina with his wife Tiara and son Ian.

View Brendan's profile on LinkedIn

Check out Devlicio.us!