Could not load file or assembly *

G

Guest

I have checked around and could not find anything here that exactly matches
my issue, which is odd since I have found numerous posts on this in other
news groups. I have a ASP .Net 2.0 site that is distributed as code (the
pages are not precompiled, but code behind is used). From time to time I get
the following error:
Could not load file or assembly 'App_Web_u2h48fgb, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system
cannot find the file specified.

The name of the assembly is different, but otherwise the error is the same.
The only work around I've found (by looking at other news groups) is to
delete the websites folder from
C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727\Temporary ASP.NET Files. Once
the folder is deleted, the web site will come up without issue.

Surely there is a better solution to this or perhaps a way to avoid this
error.
 
B

bruce barker \(sqlwork.com\)

you probably did not include page directives for references to other pages
or user controls. pages are compiled into seperate dlls, so one page can not
reference another without a page directive. but on the first compile, pages
are batched into a single dll (for compile performance), so the directive is
not required if the pages end up in the same compile batch.

-- bruce (sqlwork.com)
 
G

Guest

The directives to the controls are included in the controls that reference
them.

Also, although the app code directory is compiled into a single assembly,
each control and page are actually compiled into separate assemblies. This
is true even if you are publishing the site precompiled or the first time the
site is compiled (I removed my directory from temporary internet files and
reran my site to confirm this behavior). There are some dlls that get
created that do not appear to correspond to either a page, control or the app
code directory, and sometimes one of these has the issue, but most of the
time it is a dll from one of the controls.

What makes this error even more frustrating is that the assembly that it
references in the error is present in the directory, and often it has no
dependencies other than ASP .Net controls.

The one thing this page does have is nested user controls. The page
contains a web user control (control A), and this web user control contains
another web user control (control B). The control A has the appropriate
reference to control B, but the page only has a reference to control A. I am
hoping that you are not implying that the page has to have a reference to any
controls nested in the web user controls it contains, because this would be
pretty ridiculous and would be a maintenance nightmare (just imagine if you
modified control A down the road after it had been used in a few dozen places
and added a web user control to it).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top