Error : 'File' is ambiguous, imported from the namespaces or types

Error : ‘File’ is ambiguous, imported from the namespaces or types ‘System.IO, Microsoft.SharePoint.Client’. At line 1

Getting this above error while invoking this code…

Array.ForEach(Directory.GetFiles(folderPath),Sub(x) File.Delete(x))

How to fix this error?

2 Likes

Hi @Vinit_Mhatre

Try this

Array.ForEach(Directory.GetFiles(folderPath),Sub(x) System.IO.File.Delete(x))
3 Likes

Thanks for your help

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.