Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GAC but still get File or assembly name... was not found

Reply
Thread Tools

GAC but still get File or assembly name... was not found

 
 
=?Utf-8?B?Smlt?=
Guest
Posts: n/a
 
      06-02-2005
Hi, I have an assembly and it's satellite in my GAC.

I have referenced the DLLs in my project (from the same location where I
added it to the GAC). CopyLocal is set false.

When I run the project I get our old friend:

Parser Error
Description: An error occurred during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.

Parser Error Message: File or assembly name ....., or one of its
dependencies, was not found.

So I obtained the fusion log (I've changed the names to protect the innocent):

*** Assembly Binder Log Entry (6/2/2005 @ 11:42:56 AM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusio n.dll
Running under executable
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspne t_wp.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: DisplayName = myDLL
(Partial)
LOG: Appbase = file:///c:/inetpub/wwwroot/myApp
LOG: Initial PrivatePath = bin
LOG: Dynamic Base = C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary
ASP.NET Files\myApp\247702f1
LOG: Cache Base = C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tempo rary
ASP.NET Files\myApp\247702f1
LOG: AppName = b0b6a047
Calling assembly : (Unknown).
===

LOG: Processing DEVPATH.
LOG: DEVPATH is not set. Falling through to regular bind.
LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Post-policy reference: myDLL
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/myApp/247702f1/b0b6a047/myDLL.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/myApp/247702f1/b0b6a047/myDLL/myDLL.DLL.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/myApp/bin/myDLL.DLL.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/myApp/bin/myDLL/myDLL.DLL.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/myApp/247702f1/b0b6a047/myDLL.EXE.
LOG: Attempting download of new URL
file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
Files/myApp/247702f1/b0b6a047/myDLL/myDLL.EXE.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/myApp/bin/myDLL.EXE.
LOG: Attempting download of new URL
file:///c:/inetpub/wwwroot/myApp/bin/myDLL/myDLL.EXE.
LOG: All probing URLs attempted and failed.

The only thing interesting about this is that it *should* say that it
checked the GAC, but it doesn't, why is this? Is my machine lazy? Is it by
design ;-?

If I set CopyLocal to true it works, but of course, this violates that oh so
lovely KB article http://support.microsoft.com/?id=324519, so I can't do that.


I have checked that the versions in the GAC
myDLLSatellite, Version=2.0.0.2, Culture=neutral, PublicKeyToken=xxxx,
Custom=null
myDLL, Version=3.8.1.16824, Culture=neutral, PublicKeyToken=xxxx, Custom=null

match the references in the project.

I've restarted my machine, I've removed and readded to the GAC, I've tried
banging the side of my monitor - but none helps!

Can someone please give me an idea why this wouldn't be working?

Thanks in advance.

Jim
 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      06-03-2005
Hi Jim,

Welcome to ASPNET newsgroup.
From your description, you have a strong-named assembly with its satellite
assemblies registered in the GAC. However, when you referenced those
assemblies in your ASP.NET project , and try running the applcation, you
got

====================
Parser Error Message: File or assembly name ....., or one of its
dependencies, was not found.
====================

error, yes?

Based on my experience, the problem you encountered is likely caused by the
ASP.NET runtime is trying to referencing the strong-named assemlby as
unstrong-named(partially), we can also notice this from the following
period in the error info:

=== Pre-bind state information ===
LOG: DisplayName = myDLL
(Partial)


So as for partial named assembly, the runtime won't check the GAC. Then,
the reason why the runtime will treat your assembly as a private one maybe
caused by the <@Register ...> or <@Assembly > directive you put in the
aspx page. For example, when we drag a custom component/control onto the
asp.net page, we'll found that there occurs the following directive in aspx
template:

<%@ Register TagPrefix="cc1" Namespace="MYNamespace"
Assembly="AssemblyName" %>

and the "AssemblyName" is the partial name(not fullname), so at runtime,
since the aspx is dynamic compiled, the asp.net runtime will reference the
"AssemblyName" as private assembly (not checking GAC) which cause the error
you met. So is your custom assembly also used as the behavior I mentioned
above , or is there any other @ directive in the aspx which reference your
assembly as Partial assembly name?

If so, you can try changing the "AssemblyName" with FullName(including
culture, public keytoken.... ). In addition, we can also try putting the
following assembly referencing info in your web.config which will help
referecing certain assembly we want for all the aspx page(or other dynamic
compiled resources) in our web application.

<system.web>
.............
<compilation defaultLanguage="c#" debug="true">
<assemblies>
<add assembly="MerrillLynch.Bank.Framework.Web, version=1.1.2005.0,
publicKeyToken=80a6f6408bd93158, culture=neutral" />
</assemblies>
</compilation>
..........
</system.web>

Please have a look to see whether the above things helps. If there're
anything unclear or different, please feel free to post here. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Smlt?=
Guest
Posts: n/a
 
      06-03-2005
Wow, I hope you dont mind when people sing your praises, cos that's what I'm
about to do!!

Thanks very much!! Somebody give that man a promotion

Jim
 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      06-06-2005
You're welcome Jim,

I'm also glad that my suggestion has helped you.
Thanks again for choosing Microsoft!

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Assembly works when placed in \Bin folder, but not GAC Abe Simpson ASP .Net 3 04-10-2009 04:39 PM
Assembly not found when in GAC Web Team @ Borough of Poole ASP .Net 4 08-06-2008 01:54 PM
how much of this is still true (assembly versioning & the gac) Coaster ASP .Net 1 03-16-2007 03:06 AM
Web Assembly in GAC, Page Inherits Strongly Named Assembly? john@johnwpowell.com ASP .Net 0 12-03-2005 01:31 PM
Referencing assembly from GAC using @assembly fails Brent ASP .Net 1 01-23-2004 08:23 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57