Could not load file or assembly or one of its dependencies. Access isdenied.

Discussion in 'ASP .Net' started by Andy, Apr 2, 2008.

  1. Andy

    Andy Guest

    Hi,

    I've got a web application made in Asp.net 2.0 , C# and sql server
    2005. Its hosted on a server farm (consisting of 3 webservers). Every
    now and then we keep getting the following error

    Could not load file or assembly 'xyz, Version=1.0.0.0,
    Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    Access is denied.

    I've googled this problem and as suggested checked the permissions on
    the temp asp.net folder and excluded the folder from the antivirus
    scan list. Inspite of doing the above 2 steps I still get the access
    denied error. The occurence of the error is very inconsistent and I
    couldn't find any pattern to it.

    Can anyone suggest what could be causing this issue? Can the indexing
    service also cause this problem?

    Appreciate any help or ideas

    Thanks in advance

    Anand
     
    Andy, Apr 2, 2008
    #1
    1. Advertising

  2. RE: Could not load file or assembly or one of its dependencies. Access

    Well, if the assembly is actually present at the specified location, this is
    a permissions issue and you'll need to find out why the current Identity
    credentials of your app prohibit loading of the specified assembly. If there
    is any kind of synchronization going on "down on the farm" this could have an
    adverse effect.
    -- Peter
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short Urls & more: http://ittyurl.net


    "Andy" wrote:

    > Hi,
    >
    > I've got a web application made in Asp.net 2.0 , C# and sql server
    > 2005. Its hosted on a server farm (consisting of 3 webservers). Every
    > now and then we keep getting the following error
    >
    > Could not load file or assembly 'xyz, Version=1.0.0.0,
    > Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    > Access is denied.
    >
    > I've googled this problem and as suggested checked the permissions on
    > the temp asp.net folder and excluded the folder from the antivirus
    > scan list. Inspite of doing the above 2 steps I still get the access
    > denied error. The occurence of the error is very inconsistent and I
    > couldn't find any pattern to it.
    >
    > Can anyone suggest what could be causing this issue? Can the indexing
    > service also cause this problem?
    >
    > Appreciate any help or ideas
    >
    > Thanks in advance
    >
    > Anand
    >
     
    Peter Bromberg [C# MVP], Apr 3, 2008
    #2
    1. Advertising

  3. Andy

    Andy Guest

    Re: Could not load file or assembly or one of its dependencies.Access

    Thanks Peter,

    I thought I'd give an update on this problem. My application had 2
    assemblies that contained classed for the Data access and business
    logic layer. It was on one of them that I was getting the Access
    denied error. After checking different settings and googling I wasnt
    able to pinpoint the problem and as a temporary fix I decided to merge
    the two assemblies into one, my logic being no offending assembly no
    access denied problem. Things went fine for a couple of weeks and then
    today I get the follwing error

    System.IO.FileLoadException: Could not load file or assembly
    'System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Access is
    denied. File name: 'System.Web.Extensions.Design,
    Version=1.0.61025.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35' at
    System.Reflection.Assembly.nLoad(AssemblyName fileName, String
    codeBase, Evidence assemblySecurity, Assembly locationHint,
    StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
    forIntrospection) at
    System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
    Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
    forIntrospection) at
    System.Reflection.Assembly.InternalLoad(String assemblyString,
    Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
    forIntrospection) at System.Reflection.Assembly.Load(String
    assemblyString) at
    System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String
    assemblyName, Boolean starDirective) WRN: Assembly binding logging
    is turned OFF. To enable assembly bind failure logging, set the
    registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to
    1. Note: There is some performance penalty associated with assembly
    bind failure logging. To turn this feature off, remove the registry
    value [HKLM\Software\Microsoft\Fusion!EnableLog].


    I've started getting an access denied error on the
    System.Web.Extensions.Design assembly. Copying the dll over from my
    local machine to the bin directory of the production machine fixes the
    problem, but I still can't figure out whats causing this issue. These
    are a few things that i've already checked

    1. Permission on the temp asp.net folder
    2. Permission on the website folder (location where files are located)
    3. Excluded the temp asp.net folder from anti virus scan list
    4. Excluded the temp asp.net folder from indexing service

    What surprises me is that the access denied error is thrown for 1 dll,
    if it was a permissions issue shouldnt all the dll's in that folder be
    inaccessible?

    Another thing, my production website is hosted on a server farm. I'd
    appreciate any help I can get regarding this.



    Thanks

    Anand



    On Apr 2, 6:40 pm, Peter Bromberg [C# MVP]
    <> wrote:
    > Well, if the assembly is actually present at the specified location, this is
    > a permissions issue and you'll need to find out why the current Identity
    > credentials of your app prohibit loading of the specified assembly. If there
    > is any kind of synchronization going on "down on the farm" this could have an
    > adverse effect.
    > -- Peter
    > Site:http://www.eggheadcafe.com
    > UnBlog:http://petesbloggerama.blogspot.com
    > Short Urls & more:http://ittyurl.net
    >
    >
    >
    > "Andy" wrote:
    > > Hi,

    >
    > > I've got a web application made in Asp.net 2.0 , C#  and sql server
    > > 2005. Its hosted on a server farm (consisting of 3 webservers). Every
    > > now and then we keep getting the following error

    >
    > > Could not load file or assembly 'xyz, Version=1.0.0.0,
    > > Culture=neutral, PublicKeyToken=null' or one of its dependencies.
    > > Access is denied.

    >
    > > I've googled this problem and as suggested checked the permissions on
    > > the temp asp.net folder and excluded the folder from the antivirus
    > > scan list. Inspite of doing the above 2 steps I still get the access
    > > denied error. The occurence of the error is very inconsistent and I
    > > couldn't find any pattern to it.

    >
    > > Can anyone suggest what could be causing this issue? Can the indexing
    > > service also cause this problem?

    >
    > > Appreciate any help or ideas

    >
    > > Thanks in advance

    >
    > > Anand- Hide quoted text -

    >
    > - Show quoted text -
     
    Andy, Apr 25, 2008
    #3
    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. Philipp Schumann
    Replies:
    2
    Views:
    1,393
  2. D.C.
    Replies:
    0
    Views:
    662
  3. Replies:
    1
    Views:
    507
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Nov 2, 2007
  4. JB
    Replies:
    3
    Views:
    572
  5. hifiger2004
    Replies:
    1
    Views:
    677
Loading...

Share This Page