locked
Random "access is denied exception from hresult 0x80070005 e_accessdenied" in Visual Studio when deploying (F5) WebPart. RRS feed

  • Question

  • Periodically when I deploy (Build -> Deploy Solution) my webpart (using VSeWSS 1.1), I get the follwoing message in the Visual Studio Error List...

     

    Code Snippet
    access is denied exception from hresult 0x80070005 e_accessdenied

     

    If I wait a while it will go away and I can proceed as if nothing was ever wrong.  It seems to be completely random.  I never know when or for how long I will get this error.  Some times it lasts for 2 minutes, sometimes I have to wait 10 or more.  I have never seen any pattern to it.  Some days I never get the message at all! 

     

    I am going crazy with this problem.  Please help.  I will be your best friend forever if you can help me!

     

    Thanks,

    Kevin C

     

     

     

    Here is my enviroment:

    Server 2003 All SP and Patches.

    Microsoft Visual Studio 2005 Configuration (from the about dialog):
    Version 8.0.50727.762  (SP.050727-7600)
    Microsoft .NET Framework
    Version 2.0.50727 SP1

    Installed Edition: Professional

    Microsoft Visual Basic 2005   77626-009-0000007-41321
    Microsoft Visual Basic 2005

    Microsoft Visual C# 2005   77626-009-0000007-41321
    Microsoft Visual C# 2005

    Microsoft Visual C++ 2005   77626-009-0000007-41321
    Microsoft Visual C++ 2005

    Microsoft Visual J# 2005   77626-009-0000007-41321
    Microsoft Visual J# 2005

    Microsoft Visual Web Developer 2005   77626-009-0000007-41321
    Microsoft Visual Web Developer 2005

    Crystal Reports    AAC60-G0CSA4B-V7000AY
    Crystal Reports for Visual Studio 2005


    Extensions for SharePoint Svcs 1.1  
    Visual Studio 2005 extensions for Windows SharePoint Services 3.0 (version 1.1)

    Extensions for Windows WF   
    Windows Workflow Foundation Tools for Visual Studio

    Microsoft Visual Studio 2005 Premier Partner Edition - ENU Service Pack 1 (KB926601)  
    This service pack is for Microsoft Visual Studio 2005 Premier Partner Edition - ENU.
    Security Update for Microsoft Visual Studio 2005 Professional Edition - ENU (KB937060)  
    SQL Server Analysis Services  
    Microsoft SQL Server Analysis Services Designer
    Version 9.00.3042.00

    SQL Server Integration Services  
    Microsoft SQL Server Integration Services Designer
    Version 9.00.3042.00

    SQL Server Reporting Services  
    Microsoft SQL Server Reporting Services Designers
    Version 9.00.3042.00

    Wednesday, May 21, 2008 3:28 PM

Answers

  •  

    The solution is ......

     

    go to start -> run ->services.msc and stop the indexing service

     

    It was my problem few months ago Smile

    • Proposed as answer by Krzysiek.z Tuesday, August 26, 2008 9:20 PM
    • Marked as answer by Mike Walsh FIN Tuesday, December 28, 2010 12:28 PM
    Wednesday, May 21, 2008 11:21 PM
  • Hi,

    This may be a reason:
    The deployment will put the dll into Global Assembly Cache(GAC). If the dll is already in GAC and is used by a process then the deployment will not be able to put the dll in the GAC and will fail to proceed.


    Also the deployment may try to update some resources that is being locked by any running process.

    To get rid of the problem, find the DLL in GAC and if it's there then remove it form GAC. Now the deployment will not find the GAC there (locked by a process) and will continue.

    Also before running the deploymetn you can reset IIS. So that if the w3p process locks any resources that the deployment try to overwrite will mitigate.

    Thanks
    Sohel Rana
    Wednesday, May 21, 2008 7:09 PM

All replies

  • Hi,

    This may be a reason:
    The deployment will put the dll into Global Assembly Cache(GAC). If the dll is already in GAC and is used by a process then the deployment will not be able to put the dll in the GAC and will fail to proceed.


    Also the deployment may try to update some resources that is being locked by any running process.

    To get rid of the problem, find the DLL in GAC and if it's there then remove it form GAC. Now the deployment will not find the GAC there (locked by a process) and will continue.

    Also before running the deploymetn you can reset IIS. So that if the w3p process locks any resources that the deployment try to overwrite will mitigate.

    Thanks
    Sohel Rana
    Wednesday, May 21, 2008 7:09 PM
  • Good news and bad news.

     

    Good news Sohel, your idea about the DLL is probably the issue. 

     

    Bad news, when I get the access denied error and visist the GAC, it won't populate! 

     

    http://kevincornwell.com/misc/gac.gif

     

     

    If I wait a while and once again see the dll's in the GAC (after what seem a random amount of time), I can resume normal work. 

     

    What the heck?!

     

    Thanks,

    Kevin C

     

    EDIT:

     

     

    I found a article that described a temp workaround is to turn of the Indexing service and it works.  However this is obviously not a very good long term solution.

    http://www.sharepoint-tips.com/2006/10/gac-access-denied-solution-free-post.html

     

    Wednesday, May 21, 2008 9:17 PM
  •  

    The solution is ......

     

    go to start -> run ->services.msc and stop the indexing service

     

    It was my problem few months ago Smile

    • Proposed as answer by Krzysiek.z Tuesday, August 26, 2008 9:20 PM
    • Marked as answer by Mike Walsh FIN Tuesday, December 28, 2010 12:28 PM
    Wednesday, May 21, 2008 11:21 PM
  • Perfect!!! Smile
    Wednesday, June 11, 2008 9:32 AM
  • perfect, this also worked for me!
    Tuesday, July 1, 2008 10:00 AM
  • Finally! Thanks for the tip.
    Tuesday, September 23, 2008 2:58 PM
  • it works!!!!... stopping the indexing services allows me to see items in GAC folder again... thanks for the tips...
    Tuesday, November 18, 2008 11:48 PM
  • Thanks buddy. The solution worked perfectly for me. I tried all the other solutions that I knew, nothing worked. Stopping the indexing service allowed me to deploy the web part. Thanks a lot again.
    Friday, November 28, 2008 11:17 AM
  • I had the same problem - I found one solution at:

    http://www.eggheadcafe.com/software/aspnet/29440056/access-is-denied-except.aspx 

    This worked sometimes, but not consistently.  After reading this blog I decided to just add "iisreset" as a pre-build event and (so far!) that has solved the problem.

    Just for context, I am using Visual Studio 2008 with VSEWSS3.0 1.4 installed.

    Hope this helps!

    Wednesday, June 30, 2010 2:34 PM