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

G

Guest

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\fusion.dll
Running under executable
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_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\Temporary
ASP.NET Files\myApp\247702f1
LOG: Cache Base = C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary
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
 
S

Steven Cheng[MSFT]

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

Guest

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
 
S

Steven Cheng[MSFT]

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

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top