I am copying Windows directory from "C:" drive to "E:" drive. When we try to delete this directory from C# application then application throws "Access denied file" exception.
If we try to delete it manually, then it gets deleted successfully.
Loading


VulpesRank #55 · 29.2K reputationPosted Aug 19, 2014, 4:58 AM EDT
Gangadhar Jadhav10 reputationPosted Aug 19, 2014, 5:10 AM EDT
VulpesRank #55 · 29.2K reputationPosted Aug 19, 2014, 5:34 AM EDT
Possibly there's a hidden or system file in there.
Gangadhar Jadhav10 reputationPosted Aug 19, 2014, 5:41 AM EDT
VulpesRank #55 · 29.2K reputationPosted Aug 19, 2014, 5:44 AM EDT
Check out the possible exceptions list in this link:
http://msdn.microsoft.com/en-us/library/62t64db3(v=vs.110).aspx
Gangadhar Jadhav10 reputationPosted Aug 19, 2014, 5:47 AM EDT
VulpesRank #55 · 29.2K reputationPosted Aug 19, 2014, 6:02 AM EDT
Wait and see if anyone else has a thought on it.
VulpesRank #55 · 29.2K reputationPosted Aug 19, 2014, 6:38 AM EDT
The GAC32 and GAC64 directories are, of course, the 'Global Assembly Caches' for 32 and 64 bit .NET applications.
These will contain amongst other things the dlls for the .NET framework classes. So I'd guess that the CLR probably locks them when it loads framework dlls into the current process space.
If that's the case, you'd get an access denied exception because another process is using the directory. However, deleting them manually wouldn't be a problem because the CLR wouldn't be running at that time.
Ankur JainRank #2,475 · 567 reputationPosted Aug 19, 2014, 9:00 AM EDT
have you look at the following thread...
http://www.codeproject.com/Questions/296249/Visual-Studio-Access-Denied-Errors