469,592 Members | 1,933 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

Could not load file or assembly *

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\Temp orary 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.
Sep 19 '06 #1
2 2440
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)
"John Bailey" <Jo********@discussions.microsoft.comwrote in message
news:3C**********************************@microsof t.com...
>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\Temp orary 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.

Sep 19 '06 #2
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).

"bruce barker (sqlwork.com)" wrote:
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)
"John Bailey" <Jo********@discussions.microsoft.comwrote in message
news:3C**********************************@microsof t.com...
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\Temp orary 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.


Sep 20 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by antonyliu2002 | last post: by
1 post views Thread by Steve Wofford | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.