Virtual Happy Hour is canceled this month (March) due to Good Friday.
Try our conversational search powered by Generative AI!
AI OnAI Off
Virtual Happy Hour is canceled this month (March) due to Good Friday.
Hi,
I'm using a VirtualPathVersioningProvider for a custom folder. I have created multiple versions of files. I'm currently greating a schedules job to remove all the old versions of files. The only version that is not removed is the last added version. See code below.
var virtualFile = HostingEnvironment.VirtualPathProvider.GetFile(this.GetVirtualFilePath) as VersioningFile;
var orderByDescending = virtualFile.GetVersions().OrderByDescending(x => x.Created);
for (int i = orderByDescending.Count() - 1; i > 0; i--)
{
UnifiedVersion unifiedVersion = orderByDescending.ElementAt(i);
unifiedVersion.Delete();
}
The problem that I am facing now, is that the directories of the versions are not removed, only the file it self. How do I accomplish this?
Thanks in advanced,
Jeroen Slor