Search code examples
asp.net-mvcvisual-studio-2012access-denied

Unable to copy file, Access to the path is denied again and again and again


I kept having this annoying thing stop me from building my project over and over again even though I searched for years on stackoverflow trying to find solution but none of those I tried works. The problem just kept coming back!

The file having problem is system.web.mvc.xml, wont let me delete even I am the administrator.

Im running MVC 5 projects.

  1. tried to close vs 2012 first then delete files : fine for the next build but then it came back after 1 or 2 builds
  2. tried to un-check read-only option to my entire project folder : fine for the next try but , you know.
  3. tried to close and re-open : same as above
  4. tried to run administrator : same as above

So anyone have really get rid of this? like ever?


Solution

  • Same with me.. Finally I did this trick and work for me:

    1. Close The Solution - Close Visual Studio. And Reopen Visual Studio and solution

    2. Copy System.Web.Mvc.dll from bin folder to new fresh empty folder, I make Lib folder under solution.

    lib

    1. Remove read only at the dll

    dll read only

    1. Remove System.Web.Mvc from project reference remove
    2. Re-add System.Web.Mvc.dll (the dll copied at Lib folder) re-add

    __

    Hope This Help

    Regards