Brendan Tompkins [MVP]

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
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 


Posted 11-15-2006 10:06 AM by Brendan Tompkins
Filed under:

[Advertisement]

Comments

david wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 11-22-2006 2:21 AM

It didnt work for me.

Toby wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 01-02-2007 7:42 AM

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...

Brendan Tompkins wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 01-02-2007 8:05 AM

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

Madhu wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 01-24-2007 2:25 AM

thanks alot...it works.

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

Good work..

cheers

madhu

Darpan wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 03-16-2007 9:12 AM

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

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

Grig Gheorghiu wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-02-2007 8:10 AM

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

fff wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-04-2007 6:34 AM

not worket for me

Gavin wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-29-2007 1:38 PM

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.

Sammael Cavalera wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 09-01-2007 6:28 PM

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 ...

jrush wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 09-07-2007 10:46 AM

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?

Dave wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 09-07-2007 12:11 PM

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.

D@ wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 09-18-2007 2:34 AM

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,

Rob wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 10-07-2007 7:59 AM

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!)

Lata wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 10-11-2007 2:40 AM

Good!!

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

Lata wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 10-11-2007 2:41 AM

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

ian blair wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 10-13-2007 10:20 AM

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.

Hanno wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 11-12-2007 12:41 PM

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!

Prakash wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 11-23-2007 1:24 AM

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

Fakur wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 11-28-2007 11:01 AM

Thank you so much..

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

Jay wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 12-04-2007 2:40 PM

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

linxiang wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 12-19-2007 4:44 AM

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

Laura wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 12-29-2007 12:43 PM

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

How can i fix it in this case?

native wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 01-07-2008 6:27 PM

Thank you, it worked for me too.

Sean wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 01-24-2008 7:56 AM

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

Ahmad wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 02-01-2008 9:33 AM

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

Thank you....

mark borg wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 02-01-2008 5:20 PM

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

Ron Kuper wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 03-04-2008 9:17 PM

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!!!

Rajambal wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-06-2008 6:00 AM

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

prabhaharan wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-07-2008 1:06 AM

thanks a lot. its working...

Jacek Ciereszko wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-15-2008 3:22 PM

Thanks, You helped me :)

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

DotNetKicks.com wrote Fix for ASP.NET
on 05-15-2008 3:23 PM

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

Matthew wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-22-2008 9:54 AM

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?

Gopi wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 06-12-2008 7:42 AM

Verify the Project property

project property --> build-->platform target

birju wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 06-16-2008 12:25 AM

thanks

Marco wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 06-22-2008 1:56 PM

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

Komputerowe » Blog Archive » Problemy i cz??ste b????dy podczas pracy z Silverlight-em . Part 1 wrote Komputerowe » Blog Archive » Problemy i cz??ste b????dy podczas pracy z Silverlight-em . Part 1
on 06-26-2008 3:47 AM

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

Aysha wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 06-28-2008 6:41 AM

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

:D

Ray Akkanson wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 07-30-2008 9:08 AM

Yah, I've gotten that a bunch actually. Usually it's b/c of temp files.  Clear your temp directory and give it another try. What's happening is that the temp file name generated when the assembly is loaded exceed 255 characters. So it's truncated.  That in turn means that what it's trying to access doesn't exist.  

Here’s a related support kb addressing the issue: support.microsoft.com/.../823196

Also, set the compilation directory's tempDirectory property specifically. You can point it to C:\whatever or some shorter path name than it normally would use and thereby not have the really long path name problem.

Ray Akkanson

Jake M wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 08-07-2008 10:13 PM

I had the root folder configured as a virtual directory to run asp.net application.

The problem was I didn't create the virtual directory under the root thus asp.net was running but couldn't find the correct location of the bin folder.

Softlion wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 09-03-2008 5:24 AM

Add the batch=false attribute to your web.config 'compilation' tag :

   <compilation batch="false" />

Mark wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 09-16-2008 7:58 AM

I got this error because I had built a website in Visual Studio 2005 using the AJAX - enabled template that you get when you install the AJAX add-on for ,NET 2.0

When I came to publish the website I had forgotten to set up the folder on the web server as a virtual directory, I had just created a folder inside c:\inetpub\dev on the web server and copied the content in. So what I did was delete the folder and then create a 'proper' virtual directory using the IIS admin tool (i.e. Start --> Run --> inetmgr). This seemed to resolve the problem for me - although I did delete the temp folders as originally suggested and made some of the changes to the web.config file too so it could have been a combination of things.

trungtd wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 12-02-2008 9:28 PM

Thank for share. I'm Fixed

seaquel wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 12-16-2008 5:09 AM

You are the hacker, thanks a lot, you save my time : )

Kevin wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 12-22-2008 3:43 PM

Worked like a charm. Great post!

Joey wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 12-30-2008 3:10 AM
GB wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 01-24-2009 10:24 AM

Thanks a lot !!! it works by deleting the files.  Those with probs after deleting can try getting latest versions of the following files

- Aspnet_wp.exe

- System.web.dll

- Webengine.dll

lower version or higher version can be the cure:

see

support.microsoft.com/.../en-us

sdf wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 02-10-2009 4:20 AM
THE-ORACLE wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 02-10-2009 7:06 AM

I've faced this problem before the representation of my graduation project (B cs) by one day.

I deleted the temporary files as you said  but I needed to CLEAN THE PROJECT ( Build -> CLEAN PROJECT) then it worked nicely.

Thanks to all, and I hope you find your solution.

ave wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 02-19-2009 12:01 AM

nothing seems to work for me.......its very annoying...

veles wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 02-23-2009 8:37 AM

sorry for my English.. I learn it only serveral weeks. So..

I have in App_Code some utility class which used in code-behind. When I had added static method which use my assembly and "using" directive for it, I got this error.

In my case was reason in this using directive

Veles wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 02-23-2009 8:38 AM

sorry for my English.. I learn it only serveral weeks. So..

I have in App_Code some utility class which used in code-behind. When I had added static method which use my assembly and "using" directive for it, I got this error.

In my case was reason in this using directive

Amit wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 03-23-2009 11:25 AM

Hi,

I have tried each and every option mentioned here but still i m in mess.....It seems that app_web_*****.dll are for design only and if take everything except these dlls from bin and deploy the same on server it works(Not confirmed)......but major concern is how to get rid of these dlls....let me know if anyone have tried anything else...thanks

mabra wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-02-2009 5:40 AM

Hi !

I have the problem also. The only fix is re-compile or delete temp. The latter is horror, because the web must be stopped. The mentioned fixes won't install [I am using x64]. The temp files must be deletes for my WCF service all two minutes!!!!!

br--mabra

Mohamed ELMesseiry wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-10-2009 5:02 AM

i have found a solution for this. you are propably getting this error from a specific page.

upload the files again to the server. then restrt the IIS. and it will work.

Mohamed ELMesseiry wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-10-2009 5:03 AM

i had the same problem and the solution is to upload the files again then restart iis on the server.

nd it will work

no motrin and spinal fusion wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-11-2009 2:33 AM

Buy no motrin and spinal fusion online. <a href="odavatusuruv.livejournal.com/979.html">no motrin and spinal fusion</a>. No Prescription. We accept: VISA, MasterCard, E-check, AMEX and more.

can you take tylenol and motrin at the same time for pain wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-11-2009 2:34 AM

Buy can you take tylenol and motrin at the same time for pain online. <a href="uzyvapujibol.livejournal.com/664.html">can you take tylenol and motrin at the same time for pain</a>. No Prescription. We accept: VISA, MasterCard, E-check, AMEX and more.

children's motrin coupon wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-11-2009 2:34 AM

Buy children's motrin coupon online. <a href="uzyvapujibol.livejournal.com/858.html">children& motrin coupon</a>. No Prescription. We accept: VISA, MasterCard, E-check, AMEX and more.

motrin 800 mg wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-11-2009 2:34 AM

Buy motrin 800 mg online. <a href="itogelozylyx.livejournal.com/1229.html">motrin 800 mg</a>. No Prescription. We accept: VISA, MasterCard, E-check, AMEX and more.

how to counteract stomach upset from motrin wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-11-2009 2:34 AM

Buy how to counteract stomach upset from motrin online. <a href="yzevivejiral.livejournal.com/644.html">how to counteract stomach upset from motrin</a>. No Prescription. We accept: VISA, MasterCard, E-check, AMEX and more.

infants motrin wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-11-2009 2:34 AM

Buy infants motrin online. <a href="agisafysuvyt.livejournal.com/816.html">infants motrin</a>. No Prescription. We accept: VISA, MasterCard, E-check, AMEX and more.

cvs - cost of 60 tabs of motrin 800mg wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-11-2009 2:45 PM

Buy cvs - cost of 60 tabs of motrin 800mg online. <a href="aqyhukecujiw.livejournal.com/1013.html">cvs - cost of 60 tabs of motrin 800mg</a>. No Prescription. We accept: VISA, MasterCard, E-check, AMEX and more.

mix tylenol and motrin children wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-11-2009 2:45 PM

Buy mix tylenol and motrin children online. <a href="agisafysuvyt.livejournal.com/755.html">mix tylenol and motrin children</a>. No Prescription. We accept: VISA, MasterCard, E-check, AMEX and more.

how fast does infant motrin work wrote re: Fix for ASP.NET "Could not load file or assembly App_Web..." Error
on 05-11-2009 2:46 PM

Buy how fast does infant motrin work online. <a href="ifirezitybuk.livejournal.com/1353.html">how fast does infant motrin work</a>. No Prescription. We accept: VISA, MasterCard, E-check, AMEX and more.

Add a Comment

(required)  
(optional)
(required)  
Remember Me?