My C# code call git and cloning repository, but when my program ends i need to delete this folder with clone repo inside. When i use
Directory.Delete(path, true)
All files are deleted except .git and when program trying to delete .git -
"Access to the path 'pack-3241a6c3ea7ff447e5ba864f5d87ef66c5913670.idx' is denied."
I tried
Directory.Delete doesn't work. Access denied error but under Windows Explorer it's ok
But it won't help.
How can i solve it?