GAC and FileNotFoundException Can someone help?

Discussion in 'ASP .Net' started by Prodip Saha, Mar 22, 2005.

  1. Prodip Saha

    Prodip Saha Guest

    I am trying to load a shared component like DataAccess from GAC and not been
    able to successfully get it working for my asp.net application. The dll is
    loading from the GAC with correct version and I can verify it from Output
    window of VS.Net IDE. I can change the policy and it works because I can see
    the oldversion is redirected to newVersion.

    The problem is- unless I copy the dll in the bin directory of the
    application [from where it referenced by other components of the
    application] I get FileNotFoundException. This entirely defeats the purpose
    of have the dll in the GAC.

    I have tried the codebase but asp.net always probes the dll in the temporary
    directory like the one below-
    Attempting download of new URL
    file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
    Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc.

    So, my question is why am I getting the file not found exception while the
    file is already loaded from GAC? Am I missing something? I would appreciate
    your comments.

    Thanks,
    Prodip Saha
     
    Prodip Saha, Mar 22, 2005
    #1
    1. Advertising

  2. Prodip Saha

    Scott M. Guest

    Have you set the "Copy Local" property of the assembly reference to False?


    "Prodip Saha" <> wrote in message
    news:%...
    >I am trying to load a shared component like DataAccess from GAC and not
    >been
    > able to successfully get it working for my asp.net application. The dll is
    > loading from the GAC with correct version and I can verify it from Output
    > window of VS.Net IDE. I can change the policy and it works because I can
    > see
    > the oldversion is redirected to newVersion.
    >
    > The problem is- unless I copy the dll in the bin directory of the
    > application [from where it referenced by other components of the
    > application] I get FileNotFoundException. This entirely defeats the
    > purpose
    > of have the dll in the GAC.
    >
    > I have tried the codebase but asp.net always probes the dll in the
    > temporary
    > directory like the one below-
    > Attempting download of new URL
    > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
    > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc.
    >
    > So, my question is why am I getting the file not found exception while the
    > file is already loaded from GAC? Am I missing something? I would
    > appreciate
    > your comments.
    >
    > Thanks,
    > Prodip Saha
    >
    >
    >
    >
    >
     
    Scott M., Mar 22, 2005
    #2
    1. Advertising

  3. Prodip Saha

    Bruce Barker Guest

    you need to tell asp.net compiler where to find the assembly. in the
    compilation section of the web config add:

    <add assembly="<AssemblyFileName>, Version=0.0.0.0, Culture=neutral,
    PublicKeyToken=<keyvalue>" />


    -- bruce (sqlwork.com)


    "Prodip Saha" <> wrote in message
    news:%...
    >I am trying to load a shared component like DataAccess from GAC and not
    >been
    > able to successfully get it working for my asp.net application. The dll is
    > loading from the GAC with correct version and I can verify it from Output
    > window of VS.Net IDE. I can change the policy and it works because I can
    > see
    > the oldversion is redirected to newVersion.
    >
    > The problem is- unless I copy the dll in the bin directory of the
    > application [from where it referenced by other components of the
    > application] I get FileNotFoundException. This entirely defeats the
    > purpose
    > of have the dll in the GAC.
    >
    > I have tried the codebase but asp.net always probes the dll in the
    > temporary
    > directory like the one below-
    > Attempting download of new URL
    > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
    > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc.
    >
    > So, my question is why am I getting the file not found exception while the
    > file is already loaded from GAC? Am I missing something? I would
    > appreciate
    > your comments.
    >
    > Thanks,
    > Prodip Saha
    >
    >
    >
    >
    >
     
    Bruce Barker, Mar 22, 2005
    #3
  4. Prodip Saha

    Prodip Saha Guest

    Just wanted to add one comment- application is built with a reference to
    non-strong named version of the same dll. I mean the assembly menifest of
    the ParentAssembly does not have a publickeytoken defined for the Dependent
    assembly. Example-

    //ildasm.exe>open>ParentAssembly.dll >manifest
    ..assembly extern System.Data
    {
    .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) //
    .ver 1:0:5000:0
    }
    ..assembly extern Data.Access
    {
    .ver 1:0:1502:29024 //publickeytoken is not there because I
    did not recompile the ParentAssembly.dll
    }

    I applied the strong name and installed in the GAC at a later time. Does
    this make any difference?

    Thanks,
    Prodip

    "Prodip Saha" <> wrote in message
    news:%...
    > I am trying to load a shared component like DataAccess from GAC and not

    been
    > able to successfully get it working for my asp.net application. The dll is
    > loading from the GAC with correct version and I can verify it from Output
    > window of VS.Net IDE. I can change the policy and it works because I can

    see
    > the oldversion is redirected to newVersion.
    >
    > The problem is- unless I copy the dll in the bin directory of the
    > application [from where it referenced by other components of the
    > application] I get FileNotFoundException. This entirely defeats the

    purpose
    > of have the dll in the GAC.
    >
    > I have tried the codebase but asp.net always probes the dll in the

    temporary
    > directory like the one below-
    > Attempting download of new URL
    > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
    > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc.
    >
    > So, my question is why am I getting the file not found exception while the
    > file is already loaded from GAC? Am I missing something? I would

    appreciate
    > your comments.
    >
    > Thanks,
    > Prodip Saha
    >
    >
    >
    >
    >
     
    Prodip Saha, Mar 22, 2005
    #4
  5. Prodip Saha

    Prodip Saha Guest

    Scott,
    Yes, Local Copy is set to False.

    Thanks,
    Prodip

    "Scott M." <> wrote in message
    news:...
    > Have you set the "Copy Local" property of the assembly reference to False?
    >
    >
    > "Prodip Saha" <> wrote in message
    > news:%...
    > >I am trying to load a shared component like DataAccess from GAC and not
    > >been
    > > able to successfully get it working for my asp.net application. The dll

    is
    > > loading from the GAC with correct version and I can verify it from

    Output
    > > window of VS.Net IDE. I can change the policy and it works because I can
    > > see
    > > the oldversion is redirected to newVersion.
    > >
    > > The problem is- unless I copy the dll in the bin directory of the
    > > application [from where it referenced by other components of the
    > > application] I get FileNotFoundException. This entirely defeats the
    > > purpose
    > > of have the dll in the GAC.
    > >
    > > I have tried the codebase but asp.net always probes the dll in the
    > > temporary
    > > directory like the one below-
    > > Attempting download of new URL
    > > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
    > > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc.
    > >
    > > So, my question is why am I getting the file not found exception while

    the
    > > file is already loaded from GAC? Am I missing something? I would
    > > appreciate
    > > your comments.
    > >
    > > Thanks,
    > > Prodip Saha
    > >
    > >
    > >
    > >
    > >

    >
    >
     
    Prodip Saha, Mar 22, 2005
    #5
  6. Prodip Saha

    Prodip Saha Guest

    Bruce,
    I have tried it but it did not help-

    <assemblies>
    <add
    assembly="Data.Access,Version=1.0.1902.19083,Culture=neutral,PublicKeyToken=
    afe57206630e2fsd" />
    <add
    assembly="Interface.Data.Access,Version=1.0.1902.19082,Culture=neutral,Publi
    cKeyToken=afe57206630e2fsd" />
    </assemblies>

    Will be taking your answer. Thanks.
    Prodip

    "Bruce Barker" <> wrote in message
    news:...
    > you need to tell asp.net compiler where to find the assembly. in the
    > compilation section of the web config add:
    >
    > <add assembly="<AssemblyFileName>, Version=0.0.0.0, Culture=neutral,
    > PublicKeyToken=<keyvalue>" />
    >
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "Prodip Saha" <> wrote in message
    > news:%...
    > >I am trying to load a shared component like DataAccess from GAC and not
    > >been
    > > able to successfully get it working for my asp.net application. The dll

    is
    > > loading from the GAC with correct version and I can verify it from

    Output
    > > window of VS.Net IDE. I can change the policy and it works because I can
    > > see
    > > the oldversion is redirected to newVersion.
    > >
    > > The problem is- unless I copy the dll in the bin directory of the
    > > application [from where it referenced by other components of the
    > > application] I get FileNotFoundException. This entirely defeats the
    > > purpose
    > > of have the dll in the GAC.
    > >
    > > I have tried the codebase but asp.net always probes the dll in the
    > > temporary
    > > directory like the one below-
    > > Attempting download of new URL
    > > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
    > > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc.
    > >
    > > So, my question is why am I getting the file not found exception while

    the
    > > file is already loaded from GAC? Am I missing something? I would
    > > appreciate
    > > your comments.
    > >
    > > Thanks,
    > > Prodip Saha
    > >
    > >
    > >
    > >
    > >

    >
    >
     
    Prodip Saha, Mar 22, 2005
    #6
  7. Prodip Saha

    Prodip Saha Guest

    Just to let you all know that I got it resolved. My fear came true. I had to
    rebuild all the components (used by the app) with the strong named version
    of the dataaccess dll and all works fine. I don't have to copy dll in the
    bin directory anymore. The dll can be in the bin directory during the
    development time just for adding references. However, the framework will use
    the one from the GAC.

    Thanks you all for contributing to this thread.

    Prodip

    "Prodip Saha" <> wrote in message
    news:%...
    > I am trying to load a shared component like DataAccess from GAC and not

    been
    > able to successfully get it working for my asp.net application. The dll is
    > loading from the GAC with correct version and I can verify it from Output
    > window of VS.Net IDE. I can change the policy and it works because I can

    see
    > the oldversion is redirected to newVersion.
    >
    > The problem is- unless I copy the dll in the bin directory of the
    > application [from where it referenced by other components of the
    > application] I get FileNotFoundException. This entirely defeats the

    purpose
    > of have the dll in the GAC.
    >
    > I have tried the codebase but asp.net always probes the dll in the

    temporary
    > directory like the one below-
    > Attempting download of new URL
    > file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET
    > Files/iisvirtualpathname/c6b755e3/7450c22c/DataAccess.DLL ...etc.
    >
    > So, my question is why am I getting the file not found exception while the
    > file is already loaded from GAC? Am I missing something? I would

    appreciate
    > your comments.
    >
    > Thanks,
    > Prodip Saha
    >
    >
    >
    >
    >
     
    Prodip Saha, Mar 23, 2005
    #7
  8. Prodip Saha

    NitRaGs Guest

    Can you provide a littme more detail. May be the actual exception itself.

    Thanks
    NitRaGs

    "unknown" wrote:

    >
     
    NitRaGs, Apr 15, 2009
    #8
    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. msnews.microsoft.com

    System.IO.FileNotFoundException help

    msnews.microsoft.com, Jun 3, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,224
    msnews.microsoft.com
    Jun 3, 2004
  2. Dan Sikorsky

    get_aspx_ver.aspx and FileNotFoundException

    Dan Sikorsky, Feb 27, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    1,553
    Mark Rae
    Feb 27, 2006
  3. Ryan Stewart

    URL and FileNotFoundException

    Ryan Stewart, Dec 7, 2004, in forum: Java
    Replies:
    2
    Views:
    1,792
    Ryan Stewart
    Dec 8, 2004
  4. Namit

    WebServices and FileNotFoundException

    Namit, Jan 4, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    133
    Nakul
    Jan 4, 2004
  5. Graham Allwood

    FileNotFoundException and Proxy constructor

    Graham Allwood, Apr 14, 2004, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    122
    Jan Tielens
    Apr 15, 2004
Loading...

Share This Page