Friday, July 18, 2008

Can't publish Visual Studio 2005 Web Site because access denied error

If you get an error like "Access to the path 'C:\Documents and Settings\username\Local Settings\Temp\~6d4\bin\App_WebReferences.compiled' is denied." when you use the VS2005 | Build menu | Publish Web Site and your site impersonates a user this may help. Open up Windows Explorer and navigate to the Temp directory specified in the path. In this example, go to "C:\Documents and Settings\usb00528\Local Settings\Temp". Now right-click on the Temp directory and go to the security tab. Add the user that you are impersonating (usually specified in you web.config) and give the user Read and Write permissions. Now re-try the Publish Web Site menu item and it should publish successfully now. Yeah!

29 comments:

  1. This solved my problem, thanks!

    ReplyDelete
  2. Frits,

    I am so glad this helped you. I know it frustrated me for a while. Glad to help. Thank you for the feedback. I love knowing I make a difference.

    Brent

    ReplyDelete
  3. Thanks a lot too, this just solved my problem !

    ReplyDelete
  4. Awesome! Glad to help.

    Thank you so much for the feedback!

    Brent

    ReplyDelete
  5. Awesome! Thanks for the feedback!

    Brent

    ReplyDelete
  6. Tusi great ho (you are great! in hindi)

    saved my friday.... Thanks Dude

    ReplyDelete
  7. So glad it helped! Thanks for the feedback. Always appreciated!

    Brent

    ReplyDelete
  8. I dont know who you are but your post made my life/job easy.thank you for your help

    ReplyDelete
  9. Sree,

    I am so glad this was helpful to you. Thank you so much for the feedback.

    Brent

    ReplyDelete
  10. Wow! I am just amazed at how many people have this issue. I am so glad this is helping so many.

    Brent

    ReplyDelete
  11. Nandita,

    That you so much for the feedback. Amazingly this seems to be a common problem. I am so happy you found this useful.

    Brent

    ReplyDelete
  12. It helped alot, thanks!

    ReplyDelete
  13. Sweet! I'm so glad it helped. I am so glad I was not the only person in the world having this isue.

    Brent

    ReplyDelete
  14. Me too.. Thanks for the quick answer ...

    ReplyDelete
  15. I think this is my most helpful posting every. AWESOME!

    ReplyDelete
  16. Anonymous,

    Thank you so much for the praise. Glad to help.

    Brent

    ReplyDelete
  17. Thanks for a nice tip. It worked for me also.

    ReplyDelete
  18. Anonymous,

    Thank you for the confirmation. Rock solid!

    Thanks,

    Brent

    ReplyDelete
  19. I had the samae prblem with VS2008 and this solved it. Thanks.
    Vlado

    ReplyDelete
  20. Anonymous,

    So glad to help. Thanks for the feedback.

    Brent

    ReplyDelete
  21. Vankayala,

    Awesome! Glad it helped!

    Thx for the feedback!

    Brent

    ReplyDelete
  22. Here is an alternate solution: Comment out the entry in web.config, publish the web site, then uncomment it in the published location.

    ReplyDelete
  23. I had the same Problem with VS2010.

    But I don't understand why - but it works.

    Thank you verry much.

    ReplyDelete