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

Discussion in 'ASP .Net' started by =?Utf-8?B?Smlt?=, Jun 2, 2005.

  1. 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
    =?Utf-8?B?Smlt?=, Jun 2, 2005
    #1
    1. Advertising

  2. 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.)
    Steven Cheng[MSFT], Jun 3, 2005
    #2
    1. Advertising

  3. 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
    =?Utf-8?B?Smlt?=, Jun 3, 2005
    #3
  4. 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.)
    Steven Cheng[MSFT], Jun 6, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brent
    Replies:
    1
    Views:
    1,349
    Brent
    Jan 23, 2004
  2. Web Team @ Borough of Poole

    Assembly not found when in GAC

    Web Team @ Borough of Poole, Aug 19, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    5,622
    dananos
    Aug 6, 2008
  3. Replies:
    0
    Views:
    666
  4. Coaster
    Replies:
    1
    Views:
    382
    Coaster
    Mar 16, 2007
  5. Abe Simpson
    Replies:
    3
    Views:
    1,857
    Scott M.
    Apr 10, 2009
Loading...

Share This Page