Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot choose method from method group for File.Exists() [closed]

Tags:

c#

I am getting the error "Cannot choose method from method group. Did you intend to invoke the method".

if ((!File.Exists(pathString + "\\" + fileName + ".cs")) &&
                (!File.Exists(pathString + "\\" + fileName + ".vb")) &&
                (!File.Exists(pathString + "\\" + fileName + ".c")) &&
                (!File.Exists(pathString + "\\" + fileName + ".cpp")))
like image 413
Balaji Kondalrayal Avatar asked Dec 13 '25 11:12

Balaji Kondalrayal


1 Answers

Just use using SO=System.IO.File.Exists in top of the program and use SO.File.Exists

like image 181
Balaji Kondalrayal Avatar answered Dec 15 '25 01:12

Balaji Kondalrayal